On Aug 26, 12:23 pm, "Wojciech Placzek" <[email protected]> wrote:
>
> I need sidebar with infos about each icon where you can click on a link to
> pop the info window open on a specific marker
> I've got no idea how to put sidebar to this code.

I think what I would do is introduce a global variable which can keep
track of markers as they are added:

var markerCount = 0;

then add a div in your sidebar for each of the sets of markers:

<form name="form1" action=""><strong>Legenda</strong><br />
<img src=... /> Red
<div id="redMarkers"></div>
<img src=... /> Yellow
<div id="yellowMarkers"></div>

and then when you create your marker -- in the function addMarker --
add the marker link to the relevant div:

document.getElementById(iconStr+"Markers").innerHTML +=
  "<br><a onclick=triggerClick("+markerCount+")>"+title+"</a>";
markerCount++;

and then when you hide or unhide the markers, you can hide or display
that div as well:

document.getElementById(color+"Marker").style.display="none"; // or
"block"

You'll need another function, triggerClick:

function triggerClick(n) { GEvent.trigger(gmarkers[n],"click") }

The above code creates sidebar entries as the markers are added to the
map from the XML, and ensures that they can be identified within the
gmarkers[] array you already have. Each sidebar link triggers a click
on the corresponding marker.

-- 
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.

Reply via email to