CARI Infonet

 Forgot password?
 Register

ADVERTISEMENT

View: 2776|Reply: 4

Google Map: How to add more placemark on single map for public share

[Copy link]
Post time 9-10-2009 01:02 PM | Show all posts |Read mode
Dear all,

Sorry if i got a wrong thread to post this issue. I also dont know how to explain but i will all the best try it.

Ok, my situation is i would like to share my map on my website using Google Map platform http://maps.google.com. I would like to share more place mark on single map, i mean like this



This is from: - http://www.tourism.gov.my/en/map/?state=melaka

Currently i can 'Save My Maps' and share as public without no problembut just only can add 1 place mark/icon only on that map where i wouldlike to put more. I already do a lot of search via major search enginebut still ain't got perfect answer.


I wish someone here willing to knowledge sharing/give a guide with mehere with a good informative input. Someone simply said i have to dealwith Google Map API, but when i ask more technically that guy cannotgive me a good answer huhuhu...

So anyone here?

*p/s Huhuhuhu aku just cut n paste ajelah 100% ayat seperti mana aku tepek kat lelain forum german, uganda, pakistan huhuhuhu sorry kalu english aku xikut standard KBSM huhuhu but arap kengkawam leh paham apa yg aku cuba tanya huhuhu anyway, thanxs a lot.
Reply

Use magic Report


ADVERTISEMENT


Post time 16-10-2009 09:16 PM | Show all posts
yang satu jer kat map tu panggil placeholder. dalam url map tu ada long lat so far teknologi utk baca query as get limited pada 256 chars kot, sebab tu boleh share 1 location jer dalam map bila kita bagi url tu kat orang lain. kita cuma boleh pas url tu dengan get query, tak boleh pass as post query, so satu location jer lah.

yang dalam map kat tourism tu, dipanggil placemark. benda tu memang dah "hard coded" dalam map tu, ada orang sudah bagitau tempat tu best, lepas tu tukang jaga google map sudah kasi masuk tempat tu dalam map. so kalau tengok map, tanpa specific mana2 koordinat, kita just nampak tempat2 tu sebab dah "hard coded".

untuk mark tempat2 tu supaya dia jadi placemark ni step2 dia:
1. join google earth community. http://bbs.keyhole.com
2. download dan install google earth. http://earth.google.com
3. pusing2 earth dan zoom tahap maksimum ke tempat yang berkenaan.
4. right click, save location as
5. login forum google map. http://bbs.keyhole.com
6. pegi ke board utk submit placeholder, boleh upload map tadi, dan sertakan dengan description berkualiti tinggi dalam bahasa inggeris.
7. tunggu, dan bertawakal. kalau diterima, akan dimasukkan dalam database google earth dalam masa 2 ke 4 minggu.

pasal google map API tu, API bermakna Application Programmer Interface, kalau buat program (termasuk simple HTML page), kita boleh pass certain parameter ke server google utk dapat kan map, mcm hang send url map tu, yang query kat belakang tu boleh la panggil API, sebab dia request something dari server with simple parameter yang hang paham (hang mungkin hantar long lat palceholder hang), lepas tu server return map sebijik letak belon kat long lat tu.

tahniah, anda telah menggunakan google map API dengan jayanya.
Reply

Use magic Report

Post time 16-10-2009 09:18 PM | Show all posts
mana pegi avatar aku?
Reply

Use magic Report

Post time 16-10-2009 09:30 PM | Show all posts
aku baru teringat, 2-3 tahun lepas aku ada buat job utk view BTS satu telco ni, memang betul lah boleh guna google map API tanpa submit ke google earth community.

nanti aku cari balik php aku. dia ada satu data file, send as xml ke google map, nanti keluar semua belon2 tu siap dengan nama sekali.
Reply

Use magic Report

Post time 16-10-2009 11:52 PM | Show all posts
sorry lah lambat. bini ajak main lak. macam la hang tengok sini malam2 jumaat ni. anyway ni sample html guna google map API

save local html, open file html. kalau nak up kat server hang kena ada API key sendiri. free kat http://code.google.com/apis/maps/signup.html

API key ni utk file local jer.

[code]<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Testis</title>
<script src="http://maps.google.com/maps?file=api&amp;v=2.x&amp;key=ABQIAAAA2CKu_qQN-JHtlfQ5L7BLlRT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQl3I3p2yrGARYK4f4bkjp9NHpm5w" type="text/javascript"></script>
    <script type="text/javascript">

    function initialize() {
      if (GBrowserIsCompatible()) {
        var zoom_level = 15;
        var map_center = new GLatLng(3.160613,101.695418);
        var toilet1 = new GMarker(new GLatLng(3.151899,101.695458), {title: "Toilet 1"});
        var toilet2 = new GMarker(new GLatLng(3.157590, 101.694431), {title: "Toilet 2"});
        var toilet3 = new GMarker(new GLatLng(3.163726,101.698403), {title: "Toilet 3"});
        var toilet4 = new GMarker(new GLatLng(3.169234,101.696234), {title: "Toilet 4"});

        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(map_center, zoom_level);
        map.setUIToDefault();
        map.addOverlay(toilet1);
        toilet1.bindInfoWindow("Kat Coliseum. Bukak 24 hours. Kadang2 nasib baik awek indon lawa tetek besar jaga");
        map.addOverlay(toilet2);
        toilet2.bindInfoWindow("Belakang Pertama. Kadang-kadang tutup. Ada satu cubicle jer.");
        map.addOverlay(toilet3);
        toilet3.bindInfoWindow("Sebelah Shell. Selalu tutop. Pintu dah berapa tahun rosak tak betul2 lagi.");
        map.addOverlay(toilet4);
        toilet4.bindInfoWindow("Jalan Ipoh. Asik tutup jer. Time orang tak nak berak bukak pulak.");
      }
      else {
        alert("Your browser broke!");
      }
    }

    </script>
  </head>
  <body onload="initialize()" onunload="GUnload()">
    <div id="map_canvas" style="width: 1000px; height: 700px"></div>
  </body>
</html>[/code]

working example:

http://72.232.207.74/~badai/1016/

API key kat server aku tu works kat server aku jer. so hang nak copy source, masuk kan API key hang sendiri.

complete reference kat sini
http://code.google.com/apis/maps/

hang boleh tanya kalau stuck, nanti 2-3 bulan aku masuk balik tolong mana2 patut.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

 

ADVERTISEMENT



 

ADVERTISEMENT


 


ADVERTISEMENT
Follow Us

ADVERTISEMENT


Mobile|Archiver|Mobile*default|About Us|CariDotMy

10-5-2024 09:01 PM GMT+8 , Processed in 0.058975 second(s), 30 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

Quick Reply To Top Return to the list