ThinkGeo.com    |     Documentation    |     Premium Support

Assigning Marker Images using InMemoryMarkerOverlay

 


Is it possible to have individual images for each marker using InMemoryMarkerOverlay?


I found that you can set an image based on zoomlevels for the markers in the Features Collection. But cant seem to find a sample assigning them individually.



Allan,


Use InMemoryMarkerOverlay maybe not easy to implement your requirement, could you switch to use SimpleMarkerOverlay which can do it easily, please look at a similar thread below, it's about DesktopEdition, but it doesn't matter because they have the pretty much the API for Marker:


gis.thinkgeo.com/Support/Dis...fault.aspx


Thanks,


James




 It seems I have no choice but to use SimpleMarkerOverlay. Do you have a ceiling on the number of markers that can be created using this without being sluggish? Popups will be added in the client side. 
  


 


Allan,
 
It can support dozens of markers if popup data isn’t much. It sounds like that you want to add a lot of markers. You can expand SimpleMarkerOverlay class to meet your requirement. For example, just load the markers in current extent and load popups when your mouse over the marker dynamically. If you implement that, it’s not sluggishto create thousands of markers.
 
Thanks,

James



 


Thanks James. Maybe you have a sample on how to expand the simplemarkeroverlay class to load markers in current extent only?



Hi Allan, 
  
 I had a related problem in which I wanted to populate the marker popup individually with dataset field values. 
  
 Have a look at my code here - gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/12/aft/8634/afv/topic/Default.aspx 
  
 You can modify it for your purpose, setting an individual webimage for each marker, then it works. 


Lars, 
  
 Thanks for your sharing. 
  
 Allan, 
  
 I think you can try Lars’ idea that create a custom style instead of using SimpleMarkerOverlay. 
  
 James


 Thanks Lars. When I switch to using InMemoryMarker I’ll use that code.

Allan, 
  
 I expect good news from you. 
  
 Thanks, 
 James