See:<br>
<a href="http://trac.openlayers.org/ticket/683">http://trac.openlayers.org/ticket/683</a><br><br><div><span class="gmail_quote">On 4/25/07, <b class="gmail_sendername">Erik Uzureau</b> <<a href="mailto:erik.uzureau@metacarta.com">
erik.uzureau@metacarta.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">sending again without the build OL patch -- msg too big for list :-)
<span class="q"><br>
erik<br><br>---------- Forwarded message ----------<br><span class="gmail_quote">From: <b class="gmail_sendername">Erik Uzureau</b> <<a href="mailto:erik.uzureau@metacarta.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
erik.uzureau@metacarta.com</a>><br>Date: Apr 25, 2007 8:15 PM
<br>Subject: Re: [OpenLayers-Users] Turning on/off layers depending on zoom level<br>To: kaka <<a href="mailto:drspencer@hotmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">drspencer@hotmail.com
</a>><br>Cc: <a href="mailto:users@openlayers.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">users@openlayers.org
</a><br><br></span></span><div><span class="e" id="q_1122b76a0c0888d6_2">Hello, <br>
<br>
I have found some more time to look at this, and with your helpful
description I think I am able to see the problem (and maybe solve it). <br>
<br>
The problem is that if the layer is out of range to start with, we never hide it. That's not good. <br>
<br>
I am including a patch that seems to fix this problem in your code. <br>
<br>
Can you tell me if this fixes it for you?<br>
<br>
If you don't know how to apply patches, I've also included a freshly build OL from trunk with this patch put in. <br>
<br>
Please let me know if this fixes your problem. I would like to open a
ticket for this bug. It won't make it into the 2.4 release but in 2.5
for sure. <br>
<br>
Thanks for your bug report and your patience with explaining it :-)<br><span>
Erik</span><div><span><br><br><div><span class="gmail_quote">On 4/22/07, <b class="gmail_sendername">kaka</b> <<a href="mailto:drspencer@hotmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
drspencer@hotmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>The problems I have with the maxResolution are:<br><br>a) the markers are dislocated. Have a look at the link I posted and try<br>zooming out - the markers end up in the wrong positions.<br><br>b) the markers are visible when thy should not appear. I would like them to
<br>appear when I zoom in the map, and not on first load. However, I keep having<br>trouble with this. If they are set to show in the 0.03 resolution, the<br>example works just fine. If I set them to 0.02, or any other resolution that
<br>should make them not to render on first load, the example does no longer<br>work as expected. The markers are drawn anyway and in the wrong location as<br>mentioned in a).<br><br>Any help appreciated.<br><br>Magnus<br>
<br><br><br>Erik Uzureau-3 wrote:<br>><br>> Kaka,<br>><br>> It is hard for people to help you because we need a more detailed<br>> description of the problem.<br>> I personally do not understand what is going wrong here.
<br>> Erik<br>><br>> On 4/17/07, kaka <<a href="mailto:drspencer@hotmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">drspencer@hotmail.com</a>> wrote:<br>>><br>>>
<br>>> Any help on this issue would be greatly appreciated. Could it be that
<br>>> this<br>>> is<br>>> a bug? The example is over at<br>>> <a href="http://www.villageografica.com/test44/Africa-test.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.villageografica.com/test44/Africa-test.html</a> and my problem is
<br>>> that the maxResolution doesn´t work with the zoom ranges I want and,<br>>> also,<br>>> that the markers are not in the correct position.<br>>><br>>> Magnus<br>>><br>>><br>
>>
<br>>><br>>> kaka wrote:<br>>> ><br>>> > This is an example of the problem I have:<br>>> ><br>>> > <a href="http://www.villageografica.com/test44/Africa-test.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.villageografica.com/test44/Africa-test.html
</a><br>>> ><br>>> > If I change the maxResolution to 0.2 the map works fine, but its<br>>> current<br>>> > 0.3 won´t work. I hope this illustrates my problem.<br>>> ><br>>> > Magnus
<br>>> ><br>>> ><br>>> ><br>>> > Erik Uzureau-3 wrote:<br>>> >><br>>> >> Dear Kaka,<br>>> >><br>>> >> Do you have a live example that you could post a link to?
<br>>> >> Offhand, I can't see what the problem is... but I might be<br>>> >> able to help you out if I could see it in action<br>>> >><br>>> >> Erik,<br>>> >> Best
<br>>> >><br>>> >> On 4/10/07, kaka <<a href="mailto:drspencer@hotmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">drspencer@hotmail.com</a>> wrote:<br>>> >>>
<br>>> >>> Thank you very much, Erik, this has been a great help. However, I
<br>>> have<br>>> >>> run<br>>> >>> into a problem. If the markers are set to not show on first load, but<br>>> to<br>>> >>> appear when zooming in, the show/hide functionality stops working and
<br>>> >>> the<br>>> >>> markers are dislocated when zooming out. My code looks like this:<br>>> >>><br>>> >>> var MarkersLayer2 = new OpenLayers.Layer.Text( "Region info",
<br>>> {location:<br>>> >>> "markers.txt", maxResolution: 0.03});<br>>> >>><br>>> >>> Changing the "0.3" to "0.2" causes the problems mentioned above. Is
<br>>> this<br>>> >>> related to my code or a possible bug?<br>>> >>><br>>> >>> Magnus<br>>> >>><br>>> >>><br>>> >>><br>>> >>>
<br>>> >>> kaka wrote:<br>>> >>> ><br>>> >>> > Hi<br>>> >>> > I am trying to turn on/off a layer of markers depending on zoom<br>>> level,<br>>> >>> > using google maps as a background layer. Does anyone have
<br>>> suggestions<br>>> >>> on<br>>> >>> > how to achieve this or is there or maybe an example? Thank you for<br>>> any<br>>> >>> > ideas.<br>>> >>> >
<br>>> >>> > Regards,<br>>> >>> ><br>>> >>> > Magnus<br>>> >>> ><br>>> >>><br>>> >>> --<br>>> >>> View this message in context:
<br>>> >>><br>>> <a href="http://www.nabble.com/Turning-on-off-layers-depending-on-zoom-level-tf3550126.html#a9927966" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.nabble.com/Turning-on-off-layers-depending-on-zoom-level-tf3550126.html#a9927966
</a><br>>> >>> Sent from the OpenLayers Users mailing list archive at <a href="http://Nabble.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Nabble.com</a>.<br>>> >>>
<br>>> >>> _______________________________________________
<br>>> >>> Users mailing list<br>>> >>> <a href="mailto:Users@openlayers.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Users@openlayers.org</a><br>>> >>>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://openlayers.org/mailman/listinfo/users
</a><br>>> >>><br>>> >> _______________________________________________<br>>> >> Users mailing list<br>>> >> <a href="mailto:Users@openlayers.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Users@openlayers.org</a>
<br>>> >> <a href="http://openlayers.org/mailman/listinfo/users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://openlayers.org/mailman/listinfo/users</a><br>>> >><br>
>> >><br>>> ><br>>> ><br>>><br>>> --
<br>>> View this message in context:<br>>> <a href="http://www.nabble.com/Turning-on-off-layers-depending-on-zoom-level-tf3550126.html#a10048769" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.nabble.com/Turning-on-off-layers-depending-on-zoom-level-tf3550126.html#a10048769
</a><br>>> Sent from the OpenLayers Users mailing list archive at <a href="http://Nabble.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Nabble.com</a>.<br>>><br>>> _______________________________________________
<br>>> Users mailing list<br>
>> <a href="mailto:Users@openlayers.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Users@openlayers.org</a><br>>> <a href="http://openlayers.org/mailman/listinfo/users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://openlayers.org/mailman/listinfo/users</a><br>>><br>><br>> _______________________________________________
<br>> Users mailing list<br>> <a href="mailto:Users@openlayers.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Users@openlayers.org</a><br>> <a href="http://openlayers.org/mailman/listinfo/users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://openlayers.org/mailman/listinfo/users</a><br>><br>
><br><br>--<br>View this message in context: <a href="http://www.nabble.com/Turning-on-off-layers-depending-on-zoom-level-tf3550126.html#a10129213" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.nabble.com/Turning-on-off-layers-depending-on-zoom-level-tf3550126.html#a10129213
</a><br>Sent from the OpenLayers Users mailing list archive at <a href="http://Nabble.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Nabble.com</a>.<br><br>_______________________________________________
<br>Users mailing list<br><a href="mailto:Users@openlayers.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Users@openlayers.org</a><br><a href="http://openlayers.org/mailman/listinfo/users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://openlayers.org/mailman/listinfo/users</a><br></blockquote></div>
<br>
</span></div><br clear="all">
</span></div><br clear="all"></blockquote></div><br>