Search the web
Sign In
New User? Sign Up
ydn-flash · Yahoo! Flash Developer Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Yahoo Maps: Problem removing custom overlay   Message List  
Reply | Forward Message #1323 of 2036 |
Re: [ydn-flash] Yahoo Maps: Problem removing custom overlay

Where did you place this code? Is it in an mapZoom event handler
function? On the timeline? You have provided little context to help us
determine why your code isn't working.

My guess is that this is in an event handler. If so, your "overlay"
variable is probably null when you're at a zoomLevel that isn't 13. In
your if statement, you define overlay as a local variable. That means
the reference won't persist every time your code runs. You should save
it as a member variable in your class so that overlay is defined.
Note: if this is timeline code, then this answer probably won't be
relevant. Please give us more information about your code.

Thanks!

- Josh

On Mon, Oct 6, 2008 at 2:48 AM, bennettberlin <bennettberlin@...> wrote:
> Hi,
>
> I wish to show an overlay at zoom level 13 only. Please could somebody
> tell me what I'm doing wrong.
>
> Sequence:
> Intialize map at zoom level 14 - no overlay
> Zoom to level 13 - overlay appears
> Further zooming does not remove overlay
>
> Thanks,
>
> if (_yahooMap.zoomLevel == 13) {
>
> var latlon = new LatLon(Number(10.53), Number(104.34));
> var overlay:mapOverlay = new mapOverlay(latlon);
>
> _yahooMap.overlayManager.addOverlay(overlay);
> overlay.redraw();
> // overlay displays
>
> //_yahooMap.overlayManager.removeOverlay(overlay);
> // overlay removed
>
> } else {
> // Does not remove overlay
> _yahooMap.overlayManager.removeOverlay(overlay);
> }
>
>



Mon Oct 6, 2008 3:42 pm

joshtynjala
Offline Offline
Send Email Send Email

Forward
Message #1323 of 2036 |
Expand Messages Author Sort by Date

Hi, I wish to show an overlay at zoom level 13 only. Please could somebody tell me what I'm doing wrong. Sequence: Intialize map at zoom level 14 - no overlay ...
bennettberlin
Offline Send Email
Oct 6, 2008
2:43 pm

Where did you place this code? Is it in an mapZoom event handler function? On the timeline? You have provided little context to help us determine why your code...
Josh Tynjala
joshtynjala
Offline Send Email
Oct 6, 2008
3:42 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help