function createLine(points, id) { var polyOptions = {geodesic:true}; var polyline = new GPolyline(points, "#003fff", 5, 1, polyOptions); polyline.id = id; return polyline; } function writeArea(points) { var polygon = new GPolygon(points, "#f33f00", 5, 1, "#ff0000", 0.2); return polygon; } // create marker var SpotsInfoWindows = new Object(); function createMarker(point, category, id) { // Create our "tiny" marker icon var picto = new GIcon(); picto.image = "./content/TERcategories/"+category+"/picto_1_4.png"; picto.shadow = "./content/TERcategories/"+category+"/shadow_1_4.png"; picto.iconSize = new GSize(35, 64); picto.shadowSize = new GSize(67, 64); picto.iconAnchor = new GPoint(16, 64); picto.infoWindowAnchor = new GPoint(16, 24); // Set up GMarkerOptions object literal markerOptions = { icon:picto, draggable: false }; var marker = new GMarker(point, markerOptions); // rajouter l'id au marker marker.id = id; // bind info window with data in it $.ajax({ url: "./get.markerinfo.xhr.php", type: "GET", data: "id="+id, async: true, success: function(html) { SpotsInfoWindows[id] = html; //marker.bindInfoWindowHtml(html); // "saves" info window with marker } }); // bind event handlers GEvent.addListener(marker, "dblclick", function() { // ne fais rien }); return marker; } // hide/show categories var categoryToggle = new Object(); function hideCategory(category) { $("#on_"+category).attr({ src: "./buttons/on_inactive.png" }); $("#off_"+category).attr({ src: "./buttons/off_active.png" }); for (var i=0; i