Hi. I'm using GoogleMaps JS API (loaded via http://maps.google.com/maps/api/js?libraries=geometry&sensor=false).
I still learning about the API and I'm about to start adding data from our DB to it. Server-side, I'm using Windows+IIS+PHP+MSSQL Server 2008 R2 which contains a Geography data type. SQL is using the spatial reference ID of 4326 (GEOGCS["WGS 84", DATUM["World Geodetic System 1984", ELLIPSOID["WGS 84", 6378137, 298.257223563]], PRIMEM["Greenwich", 0], UNIT["Degree", 0.0174532925199433]]). I'm also using the PrototypeJS library to fire an ajax request when the maps idle event fires, after the map is zoomed/panned. As the user moves around, I don't want to have to fire the ajax call if we have already included the pin data from the server. The user will be looking for the closest pin to some arbitrary point (along with other data), so the user will be panning a fair bit and zooming a little. We have a premier account (though I don't know what it it or how to use it yet). I think, in essence, I'm trying to determine which approach to use with regard to getting the pin data. I'll be caching a hash of the pin data so not to add duplicates, but I'd like a way to stop the duplicate round trips. For the particular app, I do not need to worry about the situation where a new pin is logged on the DB whilst the user is working. Whilst will happen but each time a user uses the app, a clean sheet approach is used. Any idea, suggestions, examples? My only idea is to turn the current map's boundary into a polygon with multiple paths which grows/extends as the map is panned/zoomed . At each new firing of the idle event, get a polygon of the current boundary that excludes any previous boundaries and send that to the server to find the new pins in the new polygon. I think I can handle the DB side with the polygons (so, say you do a zoom out, you have a polygon with a hole in the middle where the hole contains previously retrieved data). I think I could also cache the retrieved polygons on the server (an option I'm looking into), so when I make the request to get the pins, I exclude any pin data within the previously retrieved areas. But that still involves a trip which may be nothing. Any ideas/suggestions/etc. Regards, Richard Quadling. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" 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-js-api-v3?hl=en.
