Bonjour,
j'utilise pour la premiere fois l'API google Map que j'essaie d'integrer dans un petit site sur lequel je bosse en local, j'ai trouvé un truc sur le net qui m'a permis de generer directement le script mais pour ajouter les marqueurs je galere un peu
ça marche tres bien,
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85 <!-- ++Begin Map Search Control Wizard Generated Code++ --> <!-- // Created with a Google AJAX Search Wizard // http://code.google.com/apis/ajaxsearch/wizards.html --> <!-- // The Following div element will end up holding the map search control. // You can place this anywhere on your page --> <div id="mapsearch"> <span style="color:#676767;font-size:11px;margin:10px;padding:4px;">Loading...</span> </div> <!-- Maps Api, Ajax Search Api and Stylesheet // Note: If you are already using the Maps API then do not include it again // If you are already using the AJAX Search API, then do not include it // or its stylesheet again // // The Key Embedded in the following script tags is designed to work with // the following site: // http://localhost --> <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA-Fvzs-hT2yXp_ZAY8_ufC3CFXhHIE1NvwkxS0NUtybq6oSTnzqHtaSx3X39qfrA" type="text/javascript"></script> <script src="http://www.google.com/uds/api?file=uds.js&v=1.0&source=uds-msw&key=ABQIAAAAp-Fvzs-hT2yXp_ZAY8_ufC3CFXhHIE1NvwkxS0NUtybq6oSTnzqHtaSx3X39qfrA" type="text/javascript"></script> <style type="text/css"> @import url("http://www.google.com/uds/css/gsearch.css"); </style> <!-- Map Search Control and Stylesheet --> <script type="text/javascript"> window._uds_msw_donotrepair = true; </script> <script src="http://www.google.com/uds/solutions/mapsearch/gsmapsearch.js?mode=new" type="text/javascript"></script> <style type="text/css"> @import url("http://www.google.com/uds/solutions/mapsearch/gsmapsearch.css"); </style> <style type="text/css"> .gsmsc-mapDiv { height : 275px; } .gsmsc-idleMapDiv { height : 275px; } #mapsearch { width : 365px; margin: 10px; padding: 4px; } </style> <script type="text/javascript"> function LoadMapSearchControl() { var options = { zoomControl : GSmapSearchControl.ZOOM_CONTROL_ENABLE_ALL, title : "Googleplex", url : "http://www.google.com/corporate/index.html", idleMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM, activeMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM } new GSmapSearchControl( document.getElementById("mapsearch"), "ville Pays", options ); } // arrange for this function to be called during body.onload // event processing GSearch.setOnLoadCallback(LoadMapSearchControl); </script> <!-- ++End Map Search Control Wizard Generated Code++ --> </body> </html>
en voulant ajouter ceci pour un marqueur , ça n'affiche plus ( j'ai ajouter apres function
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 var point = new GPoint(35.700328,-0.634179); // Création du point correspondant aux coordonnées nous intéressant var marker = new GMarker(point); // Création d'un marqueur localisé sur ce point mapsearch.addOverlay(marker); // Et ajout du marqueur à la carte





Répondre avec citation








Partager