API V3 et MarkerManager.js
Bonjour à tous,
j'essaye d'utiliser markerManager.js mais sans faire grand chose j'obtiens déjà les erreurs suivantes :
Citation:
GBounds is not defined
Citation:
map.getCurrentMapType is not a function
Voici le code :
Code:
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
|
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100% }
</style>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=true">
</script>
<script src="http://gmaps-utility-library-dev.googlecode.com/svn/tags/markermanager/1.1/src/markermanager.js">
</script>
<script type="text/javascript">
var TheMap;
function initialize()
{
var latlng = new google.maps.LatLng(48.8566140, 2.3522219);
var myOptions =
{
zoom: 3,
center: latlng,
mapTypeId: google.maps.MapTypeId.TERRAIN
};
TheMap = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
markers();
}
function markers()
{
var marker = new google.maps.Marker
(
{
position : TheMap.getCenter(),
map : TheMap,
title : "Nouveau Marker"
}
)
var mgr = new MarkerManager(TheMap);
mgr.addMarker(marker);
mgr.refresh();
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width:100%; height:100%"></div>
</body>
</html> |
Concernant le contexte, je débute dans l'utilisation des API google maps et javascript, mon but est de créer une map avec des marker regroupés par catégorie, qui peuvent être afficher ou non à l'aide de radio boutons.
J'ai cru comprendre qu'il fallait passer par le markermanager.
Pour le moment j'arrive à créer un marker sur une carte. On avance ... mais je n'arrive pas à utiliser le marker manager.
A votre bon coeur ...