Google Maps on my Visual Force page doesn't show all markers as the number of results fetched

后端 未结 2 999
逝去的感伤
逝去的感伤 2021-01-26 03:13

I am trying to develop a visual force page which shows \"Program Locations\". On page load it fetches all the programs and displays on the map using a marker. There are some fil

相关标签:
2条回答
  • 2021-01-26 04:01

    Following is a good article for anyone developing something like this.

    https://bryandf11.wordpress.com/2011/08/22/geocoding-in-apex-triggers-callouts-and-future-methods/

    0 讨论(0)
  • 2021-01-26 04:18

    You are running into the Geocoder error OVER_QUERY_LIMIT (from experience you can geocode approximately 11 addresses quickly before running into the rate limit). To verify add an else to the status check:

            geocoder.geocode({'address':address}, function (results, status) {
                if (status == google.maps.GeocoderStatus.OK) {
                    coords.push(results[0].geometry.location);
                } else alert("Geocode failed, status = "+status);
    

    Options:

    • geocode your addresses offline and use the coordinates to display the markers rather than the addresses
    • see this question on SO for a way to throttle the geocode requests
    0 讨论(0)
提交回复
热议问题