Controlling marker from external Event
How I can add external control like click event to any anchor out side of map to open a marker. Is there any stand alone example or can any one guide me how I can achieve this.
here is example but he is using his library. I can not use his library because my most of the code is already completed.
http://vig开发者_运维知识库etlabs.github.com/jmapping/examples/category_function.html
It sounds like you are just trying to open an info window based on a click event on some DOM element?
If that is the case, you just need to add an onClick handler to the DOM element and call a javascript function that can locate the appropriate GMarker object and trigger it's click event:
// gmarkers is an array of markers that we added to the map
var gmarkers = [];
function triggerClick (indexofMarker)
{
GEvent.trigger(gmarkers[indexofMarker], "click");
}
You can find an example of this here (source).
精彩评论