Ok, i think i explained but dont´worry, let´s go again.
I have the map with a XML archive for ayone put their markers on the
map. The xml is just for the markers data base, not for the icons.
Now i want to change the icons.
For it i read this tutorial http://googlemapsapi.blogspot.com/2005/11/
happy-turkey-day.html
But in my map the code is different and i don´t know why. In my code
i don´t see the image code line for change the icon.
This is my code.
<script type="text/javascript">
$(document).ready(function() {
var mark;
var pointA;
if (GBrowserIsCompatible()) {
var m = $("#map")[0];
if(m) {
var map = new GMap2(m);
// iniciamos el mapa en esta ubicacion, tu puedes ubicarla donde
gustes
var start = new GLatLng(40.380028,-3.735352);
// otras configuraciones
var zoomLevel = 5;
map.setCenter(start, zoomLevel);
map.addControl(new GMapTypeControl());
map.addControl(new GLargeMapControl());
map.addControl(new GScaleControl());
map.addControl(new GOverviewMapControl());
// lectura del archivo comparte.xml con jQuery
$.get('comparte.xml',function(data) {
$(data).find('marker').each(function(){
var lat = $(this).attr('lat');
var lng = $(this).attr('lng');
var html = $(this).attr('name')+"<br />";
html += $(this).attr('msg')+"<br />";
html += $(this).attr('link');
var point = new GLatLng(lat,lng);
var marker = new GMarker(point);
map.addOverlay(marker);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
});
});
// en cada nueva marca aparecer el formulario HTML
GEvent.addListener(map, 'click', function(overlay, point){
if(mark) {
map.removeOverlay(mark);
}
if(point) {
pointA = new GPoint(point.x, point.y);
mark = new GMarker(pointA);
map.addOverlay(mark);
map.getCenter(point);
var lat = point.y;
var lng = point.x;
var form =
"<form action=\"comparte-tu-medio-litro-de-aire.php\" method=
\"post\">"+
"<input type=\"hidden\" name=\"lat\" value=\""+lat+"\" />"+
"<input type=\"hidden\" name=\"lng\" value=\""+lng+"\" />"+
"Nombre:<input type=\"text\" name=\"name\" value=\"\" /><br />"+
"Msg:<input type=\"text\" name=\"msg\" value=\"\" /><br />"+
"Web:<input type=\"text\" name=\"link\" value=\"\" /><br />"+
"<input type=\"submit\" name=\"submit\" value=\"save\" />"+
"<\/form>";
map.openInfoWindowHtml(point,form);
}
});
}
}
});
</script>
When i try change any line of my code, the map stop works.
Is the problem for the api version?
Thanks
El 10/11/2008, a las 11:09, Rossko escribió:
>
> Well, you haven't told us what you want to do.
> Change all markers to a single different image?
> Use some data in your XML to choose which marker image to use?
>
> You'd probably get more help if you tried to implement what you want,
> and showed us what didn't work.
> "Write my code for me" generally doesn't get good responses, when
> examples are available.
>
> cheers, Ross K
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---