> > My Problem is that when a polyline comes, the same Text will be
> > written two times at the sidebar. But I want it only one time for the
> > polyline and one time for the simple Icon.
>
> Re-write your createMarker function to accept an extra parameter,
> something like 'addSidebar' to be set true or false.
> Only add the sidebar entry if its true.
> Alter your XML parsing code to pass this new parameter as true where
> you want it, and false where you don't.
yes, your idea is good. I added the parameter to createMarker like
this:
var addSidebar;
function createMarker(point,addSidebar, a,b, icon,info) {
if (addSidebar==true){
var marker = new GMarker(point, {icon:icon});
var i = gmarkers.length;
gmarkers.push(marker);
side_bar0_html += '<a href="javascript:myclick(' + i + ')">' +
a + '<\/a><br>';
side_bar1_html += '<a href="javascript:myclick(' + i + ')">' +
b + '<\/a><br>';
GEvent.addListener(marker, "click", function() {
var iwAnchor = marker.getIcon().infoWindowAnchor;
var iconAnchor = marker.getIcon().iconAnchor;
var offset = new GSize(iwAnchor.x-iconAnchor.x,iwAnchor.y-
iconAnchor.y);
var info = "<h5>"+a+' in '+b+"</h5> ";
map.openInfoWindow(marker.getLatLng(), info,
pixelOffset:offset}); });
return marker;
} }
but can you give me a tip how can I alter my XML parsing code?
Thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---