Hey Michael- Okay, I understand the issue. Can you file a feature request in the Issue Tracker, ideally with your exact recommendations for the boolean? http://code.google.com/p/gmaps-api-issues/issues/entry?template=Flash%20API%20-%20Feature%20Request
Thanks! - pamela On Sun, Nov 2, 2008 at 7:30 AM, Michael Allman <[EMAIL PROTECTED]>wrote: > > I use the move and zoom listeners to track user interaction with the > map. If I move the map programmatically, that's not user > interaction. It's a false positive. In my case, I make a network > call whenever the user moves or zooms the map. However, if I > programmatically move or zoom the map, that's not user interaction and > I shouldn't be making that network call. It's rather expensive so > it's kind of a big deal. > > So when do I move or zoom the map programmatically? When the user > enters an address to geocode and display on the map, I adjust the map > and make the network call. However, since adjusting the map > programmatically also makes network calls, I end up with several > redundant, expensive network calls. > > As an ugly but functional workaround, I remove the move and zoom event > listeners before I programmatically move and zoom the map and then re- > add them afterward. It works, but it's not pretty. > > I think that generally, people add the move and zoom event listeners > to react to user interaction. Firing those events as part of a > programmatic move or zoom are false positives in that case. > > Generally, if I want to fire an event programmatically, I call > dispatchEvent(). This way, you can handle both use cases. If you > fire the event as part of another method call, it's impossible to > suppress that event. > > Perhaps as a compromise, you can add an optional boolean parameter > (default true) to the relevant map adjustment methods that fire events > to control firing of events? This would provide backward > compatibility and the ability to suppress firing of events when > desired. > > Thanks again. If nothing else, I will just continue to use my > workaround. > > Cheers. > > Michael > > On Nov 1, 1:02 pm, "pamela (Google Employee)" <[EMAIL PROTECTED]> > wrote: > > Hey Michael- > > Hmm, I don't think so. Why would you not want to fire event listeners? > > > > - pamela > > > > On Sun, Nov 2, 2008 at 3:01 AM, Michael Allman <[EMAIL PROTECTED] > >wrote: > > > > > > > > > Thanks, Pamela. That's really helpful. I will use the "accuracy" > > > until the bounding box becomes available. > > > > > I've run into one other issue. When I call map.setCenter() and > > > map.setZoom(), they fire their respective event listeners. I need to > > > be able to programatically move and zoom the map without firing event > > > listeners. Is this possible? I can only think of hacks to resolve > > > this... > > > > > Thank you. > > > > > Michael > > > > > On Nov 1, 3:23 am, "pamela (Google Employee)" <[EMAIL PROTECTED]> > > > wrote: > > > > Hi Michael- > > > > Glad to hear you're porting to us! > > > > > > Re 1- The closest thing we return right now is the "accuracy" > number. > > > Most > > > > developers I know use that for zooming. We announced a month ago that > > > we'll > > > > soon add a "bounding box" output in the geocoder, to make it easy to > zoom > > > to > > > > the optimal bounds. That change has not gone out yet. > > > > > > Re 2- I use this to calculate the radius of the map: > > > > > > var bounds = map.getLatLngBounds(); > > > > var radius = > bounds.getCenter().distanceFrom(bounds.getNorthEast()); > > > > > > Hope that helps. > > > > > > - pamela > > > > > > On Sat, Nov 1, 2008 at 4:41 PM, Michael Allman < > [EMAIL PROTECTED] > > > >wrote: > > > > > > > I am porting a Flex mapping application from the Yahoo! maps > library > > > > > to the Google maps library and have run into a couple of roadblocks > > > > > along the way. > > > > > > > 1. Yahoo! maps geocoder returns a zoom level with a geocoding > result > > > > > to indicate the natural or best fit zoom level for a given address. > > > > > Google maps geocoder doesn't seem to. How do I get the natural > zoom > > > > > level for a given location? (For example, Google Maps, the main > site, > > > > > has this feature. Search for 'Los Angeles' and the map zooms to > the > > > > > right level.) > > > > > > > 2. Yahoo! maps library comes with a utility function > > > > > RadiusConversion.zoomToRadius that converts a map zoom level to a > map > > > > > radius in meters. How do I compute this with the Google maps > library? > > > > > > > Cheers, > > > > > > > Michael > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API For Flash" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-maps-api-for-flash?hl=en -~----------~----~----~----~------~----~------~--~---
