Hello,
I would attach an event on the WebImage (click, mousemove, etc.) in a marker, that would'nt open a popup but do something else like launch another action. Is it possible?
Thank you!
Best regards,
André
Hello,
I would attach an event on the WebImage (click, mousemove, etc.) in a marker, that would'nt open a popup but do something else like launch another action. Is it possible?
Thank you!
Best regards,
André
Andre,
It’s possible to attache an event on a WebImage in a marker. Please look at our HowDoI samples->Markers->ClickEventOnAMarker sample.
Thanks,
James
Hi James,
Thank you for your answer.
I would do it like that (I don’t want do it on server side):
var OnMapCreated = function(map)
{
var markerOverlay = map.getLayer(‘POINTS FIELDS’);
for (var i =0;i<markerOverlay.markers.length;i++)
{
var marker = markerOverlay.markers;
marker.events.register(‘click’, marker, showid(marker.id));
}
}
but it does’nt work. And I would do it with InMemoryMarkerOverlay.
Can I do that?
Thank you again,
Best regards,
André
Andre,
You can look at the sample code at another post, just replace the 'mouseover' to 'click'.
gis.thinkgeo.com/Support/Dis...fault.aspx
Thanks,
James
James,
thank you again. I almost succeed to do what I wanted with your help, but I have a last (I hope!) problem: the marker overlay is loaded, but if I do a loop like
var markerOverlay = tgMap.getLayer(‘POINTS FIELDS’);
var
j= markerOverlay.markers.length;
for (var i=0;i<j;i++)
{
var marker = markerOverlay.markers;
…}
j is null, and the markers are not loaded. I have to wait to loop on the markers (if I put a break point, an “alert”, it works). I’ve tried to use “loadend” event on the marker layer to begin the loop and attach the events to, but I have the same result. How can I do to be sure the markers are present in the layer before doing my task?
Best Regards,
André
Andre,
I think you still didn’t understand fully, your code is the same the the original one, please refer another post about it what the James sent to you again. For your sample, in the OnMapCreated method, all of the maker/marker overlays are null except the SimpleMakerOverlay, so when you tried to get the count of markers, it returned null, I believe your markerOverlay is not the SimpleMarkerOverlay.
So please check your code again if there are any more questions please let me know,
Thanks,
Scott,
Scott,
you’re right, I use InMemoryMarkerOverlay. So If I’ve understood now, I can’t use this way to attach event clien tside. Either I use SimpleMarkerOverlay and I can attach events client side but I can’t use the popups, or I use InMemoryMarkerOverlay with popups, but I can’t attach my events client side. Am I right?
Thank you again and sorry for disturbing you.
André
Andre,
Yes, you are right, I think you understand it fully, so please look for another way to implement your requirements, I think maybe you can use the update panel to implement the ajax effect and you just need to write the code on the server side. You can have a try.
Thanks,
Scott,