Yes, that code is doing 122 every page load. The new code I am writing will only geocode one location one time. Then it is perma-cached. (These locations will never move - they are massive facilities).
But I will build the throttling in, in case more than 10 more are input into the system at one time. I figure if it can throttle the initial 122 load okay, it should be good for any future data entered. I'll do 122 item geo-code myself (pre-geocode), so when this goes live the first person to hit the page won't be the unlucky one with a wait time... Thanks again On Tue, Feb 9, 2010 at 1:47 PM, Daniel Lee <[email protected]> wrote: > There's a way to throttle the requests off to our Geocoder using > JavaScript. Try creating a wait function to send off 5 geocode requests > every second (i.e. 200ms intervals). If the requests are still failing, > increase the delay, etc. > > Saxan, are you geocoding the same 122 locations every page load? If so, > you should probably pre-geocode them instead of geocoding them at run-time. > > > > > > On Tue, Feb 9, 2010 at 7:28 AM, Saxan Sartar <[email protected]>wrote: > >> thanks. I found this thread, says 10 results every 5 seconds. >> >> >> http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/95f6a177c8ce6d23?pli=1 >> >> Not sure what the final answer is, but I will make the changes flexible >> enough to handle any interval. >> >> Thanks for all the help. >> >> -Tim >> >> >> On Tue, Feb 9, 2010 at 9:04 AM, Van Thieu <[email protected]> wrote: >> >>> you can't ping more than once ever 1 second or 20 results per page. >>> >>> On 9 February 2010 09:55, Saxan Sartar <[email protected]> wrote: >>> >>>> Thanks, it's coming back with OVER_QUERY_LIMIT. Haha, I guess I abused >>>> it too much. >>>> >>>> Thanks Daniel, I'll get some funding approved and get a fix in to come >>>> off the 122 hits on the page load. >>>> >>>> However, we'd still like to geocode the ad hoc searches. Anyway I can >>>> seek redemption and get my query limit reset? >>>> >>>> -Tim >>>> >>>> >>>> On Mon, Feb 8, 2010 at 6:45 PM, Daniel Lee <[email protected]>wrote: >>>> >>>>> Saxan, it sounds like your app is yielding unsuccessful geocoding >>>>> responses. >>>>> >>>>> What values are you getting of google.maps.GeocoderStatus in your >>>>> drawMappable() function? >>>>> >>>>> >>>>> On Mon, Feb 8, 2010 at 12:15 PM, Saxan Sartar >>>>> <[email protected]>wrote: >>>>> >>>>>> sorry, I know the code is more than a sandbox. I can try to build one >>>>>> if that helps. >>>>>> >>>>>> Also, I wanted to mention the json does contain lat/lng, but it is not >>>>>> used. Originally I used this instead of geocoding, but we found it was >>>>>> not >>>>>> precise enough and was off by miles. The issue is with how our data was >>>>>> stored, so ... geocoding was a quick fix. >>>>>> >>>>>> And why does it call the geocoder 122 times every page load.... >>>>>> instead of cache? The answer: This project had no funding, I was not >>>>>> allowed >>>>>> to spend any more time on it. >>>>>> >>>>>> >>>>>> Despite these flaws, I wanted to thank you for looking at it. >>>>>> >>>>>> >>>>>> On Mon, Feb 8, 2010 at 1:58 PM, Saxan Sartar >>>>>> <[email protected]>wrote: >>>>>> >>>>>>> Has the geocoder services changed since last week? >>>>>>> >>>>>>> >>>>>>> On Mon, Feb 8, 2010 at 1:54 PM, Saxan Sartar <[email protected] >>>>>>> > wrote: >>>>>>> >>>>>>>> Just loading the page shows the error. No need to use the search >>>>>>>> (although it appears to have the same issue). >>>>>>>> >>>>>>>> form loads: >>>>>>>> doLoad() is called in transearch.js >>>>>>>> >>>>>>>> function doLoad() { >>>>>>>> InitQueryCode('city'); >>>>>>>> var initFocus = document.getElementById('address'); >>>>>>>> if (initFocus != null) initFocus.focus(); >>>>>>>> drawInitialMap(); >>>>>>>> } >>>>>>>> >>>>>>>> drawInitialMap() fires next: >>>>>>>> >>>>>>>> function drawInitialMap() { >>>>>>>> ... boring ajax stuff >>>>>>>> >>>>>>>> until finally: >>>>>>>> >>>>>>>> ==> drawMarkers(map, jsonObj); >>>>>>>> } >>>>>>>> >>>>>>>> If you use firebug, you can see the Mappables are loaded properly >>>>>>>> from the geocoder services. (Console \ JSON or Console \ Response) >>>>>>>> >>>>>>>> drawMarkers should just iterate through the JSON Mappables array and >>>>>>>> write the markers.. but this is what has stopped working properly. >>>>>>>> >>>>>>>> function drawMarkers(map, jsonObj) { >>>>>>>> var geocoder = new google.maps.Geocoder(); >>>>>>>> >>>>>>>> if (jsonObj.Mappables.length > 0) { >>>>>>>> for (var i = 0; i < jsonObj.Mappables.length; i++) { >>>>>>>> var mappable = jsonObj.Mappables[i]; >>>>>>>> drawMappable(map, mappable, geocoder); >>>>>>>> } >>>>>>>> } >>>>>>>> } >>>>>>>> >>>>>>>> and finally drawMappable is called. However, it is acting like the >>>>>>>> status is not OK or something like it used to be. I am still debugging >>>>>>>> this >>>>>>>> part now. >>>>>>>> >>>>>>>> function drawMappable(map, mappable, geocoder) { >>>>>>>> var lat = 0; >>>>>>>> var lng = 0; >>>>>>>> var searchAddress = (mappable.addr + ' ' + mappable.city + ' ' + >>>>>>>> mappable.st + ' ' + mappable.zip); >>>>>>>> geocoder.geocode({ >>>>>>>> address: searchAddress >>>>>>>> }, >>>>>>>> function(results, status) { >>>>>>>> if (status == google.maps.GeocoderStatus.OK && >>>>>>>> results.length) { >>>>>>>> if (status != >>>>>>>> google.maps.GeocoderStatus.ZERO_RESULTS) { >>>>>>>> var marker = new google.maps.Marker({ >>>>>>>> position: >>>>>>>> results[0].geometry.location, >>>>>>>> map: map, >>>>>>>> clickable: true, >>>>>>>> icon: "blue-dot.png?open", >>>>>>>> title: mappable.name >>>>>>>> }); >>>>>>>> mapListener(map, marker, mappable); >>>>>>>> } >>>>>>>> } >>>>>>>> }); >>>>>>>> } >>>>>>>> >>>>>>>> I did remove the references to the kmbox stuff in my sandbox just >>>>>>>> now and replaced it with the new Circle overlay in the API. Nice >>>>>>>> feature, >>>>>>>> thanks for adding it. Still same issue however. >>>>>>>> >>>>>>>> -Tim >>>>>>>> >>>>>>>> >>>>>>>> On Mon, Feb 8, 2010 at 1:37 PM, Daniel Lee <[email protected]>wrote: >>>>>>>> >>>>>>>>> I took a look at your application, and it's quite large. >>>>>>>>> >>>>>>>>> Can you reply back with specific steps to reproduce this? For >>>>>>>>> example, do I need to search a specific zip code? >>>>>>>>> >>>>>>>>> Are you geocoding all 122 points on the map? >>>>>>>>> >>>>>>>>> On Mon, Feb 8, 2010 at 10:58 AM, Saxan Sartar < >>>>>>>>> [email protected]> wrote: >>>>>>>>> >>>>>>>>>> I have a page that currently prints 122 points on the map from >>>>>>>>>> your geocoder services. >>>>>>>>>> >>>>>>>>>> But after this change, only 1 point is shown. >>>>>>>>>> >>>>>>>>>> http://domino.bnsf.com/website/premtransloader.nsf/SBDest?Open >>>>>>>>>> >>>>>>>>>> If I throw an alert in my drawMarkers() function >>>>>>>>>> >>>>>>>>>> alert(jsonObj.Mappables.length); --> I get 2 of the 122 markers, >>>>>>>>>> instead of 1. >>>>>>>>>> >>>>>>>>>> The functions are defined in transearch.js (found in the same >>>>>>>>>> relative path). >>>>>>>>>> >>>>>>>>>> Prior to the new release, this was not happening. I am looking >>>>>>>>>> into it, and also wanted to share with you. >>>>>>>>>> >>>>>>>>>> -Tim >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Mon, Feb 8, 2010 at 12:49 PM, Daniel Lee <[email protected] >>>>>>>>>> > wrote: >>>>>>>>>> >>>>>>>>>>> We've recently pushed out a new version of the API. See the list >>>>>>>>>>> of >>>>>>>>>>> changes below: >>>>>>>>>>> >>>>>>>>>>> http://code.google.com/p/gmaps-api-issues/wiki/JavascriptMapsAPIv3Changelog >>>>>>>>>>> >>>>>>>>>>> Changed issues: >>>>>>>>>>> - Issue 2135: Bug: If you reuse a Polygon's MVCArray in a >>>>>>>>>>> Polyline, >>>>>>>>>>> the Polyline is closed. >>>>>>>>>>> >>>>>>>>>>> Noticeable changes: >>>>>>>>>>> - Added new Rectangle class: >>>>>>>>>>> >>>>>>>>>>> http://code.google.com/apis/maps/documentation/v3/reference.html#Rectangle >>>>>>>>>>> - Added new Circle class: >>>>>>>>>>> >>>>>>>>>>> http://code.google.com/apis/maps/documentation/v3/reference.html#Circle >>>>>>>>>>> - Fixed memory leak when creating then removing a marker. >>>>>>>>>>> - Stopped annotating the MVCArray of LatLngs to close Polygons, >>>>>>>>>>> as >>>>>>>>>>> that causes Polylines which share the same MVCArray to be closed >>>>>>>>>>> too >>>>>>>>>>> (see Issue 2135 above) >>>>>>>>>>> - Fixed a bug which sometimes hid onscreen markers if the map's >>>>>>>>>>> zoom >>>>>>>>>>> was set to its current value. >>>>>>>>>>> - Fixed ImageMapType to display correctly on Android. >>>>>>>>>>> - Changed the polygon clipping scheme to allow polygons which >>>>>>>>>>> contain >>>>>>>>>>> the north or south pole. >>>>>>>>>>> - Increased the latitude range of MercatorProjection to the >>>>>>>>>>> maximum >>>>>>>>>>> possible subject to floating point precision. >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Please test and provide feedback. >>>>>>>>>>> >>>>>>>>>>> Thanks! >>>>>>>>>>> >>>>>>>>>>> Dann >>>>>>>>>>> >>>>>>>>>>> -- >>>>>>>>>>> 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]<google-maps-js-api-v3%[email protected]> >>>>>>>>>>> . >>>>>>>>>>> For more options, visit this group at >>>>>>>>>>> http://groups.google.com/group/google-maps-js-api-v3?hl=en. >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> 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]<google-maps-js-api-v3%[email protected]> >>>>>>>>>> . >>>>>>>>>> For more options, visit this group at >>>>>>>>>> http://groups.google.com/group/google-maps-js-api-v3?hl=en. >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> Daniel Lee >>>>>>>>> Developer Programs Engineer >>>>>>>>> Google, Inc. >>>>>>>>> 345 Spear Street >>>>>>>>> San Francisco, CA 94105 >>>>>>>>> 650 253 0967 >>>>>>>>> >>>>>>>>> -- >>>>>>>>> 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]<google-maps-js-api-v3%[email protected]> >>>>>>>>> . >>>>>>>>> For more options, visit this group at >>>>>>>>> http://groups.google.com/group/google-maps-js-api-v3?hl=en. >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>> -- >>>>>> 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]<google-maps-js-api-v3%[email protected]> >>>>>> . >>>>>> For more options, visit this group at >>>>>> http://groups.google.com/group/google-maps-js-api-v3?hl=en. >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Daniel Lee >>>>> Developer Programs Engineer >>>>> Google, Inc. >>>>> 345 Spear Street >>>>> San Francisco, CA 94105 >>>>> 650 253 0967 >>>>> >>>>> -- >>>>> 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]<google-maps-js-api-v3%[email protected]> >>>>> . >>>>> For more options, visit this group at >>>>> http://groups.google.com/group/google-maps-js-api-v3?hl=en. >>>>> >>>> >>>> -- >>>> 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]<google-maps-js-api-v3%[email protected]> >>>> . >>>> For more options, visit this group at >>>> http://groups.google.com/group/google-maps-js-api-v3?hl=en. >>>> >>> >>> -- >>> 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]<google-maps-js-api-v3%[email protected]> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/google-maps-js-api-v3?hl=en. >>> >> >> -- >> 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]<google-maps-js-api-v3%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/google-maps-js-api-v3?hl=en. >> > > > > -- > Daniel Lee > Developer Programs Engineer > Google, Inc. > 345 Spear Street > San Francisco, CA 94105 > 650 253 0967 > > -- > 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]<google-maps-js-api-v3%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-maps-js-api-v3?hl=en. > -- 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.
