I am using a simplemarkeroverlay because I need to allow dragging of the markers. I would also like these draggable markers to only be visible when zoomed into a certain level. Any ideas on how I might be able to have a draggable marker overlay that I could the set zoomlevels on?
SimpleMarkerOverlay ZoomLevel
Hi, David
We don't support zoom levels for SimpleMarkerOverlay. Here is a workaround for you temporarily. Please check out in the attachment.
Thanks,
Khalil
1969-code.txt (1.11 KB)
I know it has been 3 years since my initial post and your reply, but I am trying to use the workaround you sent and the map just loads a blank grey background when I try to use this script. Is this compatible with version 7? Is there anything else that has been implemented in the versions since my last post that would allow me to hide these at certain zoom levels?
Thanks!!!
Dave
Got it. I am using master pages, so I think that was part of the problem. Here is the script I am using now and I am getting the desired behavior. Note the ‘MainContent_’ prefix on the map name. I think this is required because of my master page. You also have to set the OnClientExtentChanged=“hideDisplayMarkers” in the map control. Anyhow, this works!
<asp:content id=“Content2” contentplaceholderid=“MainContent” runat=“server”></asp:content>
Sorry, script is screwing up the post on edits. Here is the script again.
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript">
function hideDisplayMarkers(e) {
var map = MainContent_mapX.GetOpenLayersMap();
if (map.zoom < 14) {
map.layers[3].display(false);
map.layers[4].display(false);
map.layers[5].display(false);
}
}
</script>
Hi David,
Good to hear you figured out and the code looks good.
If any other queries, don’t hesitate to let us know.
Regards,
Johnny
Hi David,
Good to hear you figured out and the codes looks well.
If any other queries, don’t hesitate to let us know.
Regards,
Johnny