Reputation: 21
I am using the google geocodeing and for a lot of the rural addresses the marker gets placed in the middle of the lot. What I need to have is the marker placed on the street in front of the address that was geocoded.
Here is a link to what I currently have for testing. http://www.commsoft.net/maps/index.html
Any suggestions would be greatly appreciated.
Upvotes: 2
Views: 686
Reputation: 161374
Upvotes: 0
Reputation: 1707
You could possibly use the Google Maps API StreetViewService to get the street location you need.
Google Maps API - Directly Accessing Street View Data
Send that location, a search radius, and a callback function to the streetview service:
var streetViewService = new google.maps.StreetViewService();
streetViewService.getPanoramaByLocation(location, searchRadius, callbackFunction);
The streetViewService will respond with the closest streetView photo it has to your location. In your callback function, callbackFunction(data, status)
, data.location.latLng
will contain the location on the street where that streetview photo was taken.
It isn't a perfect solution, but it might be the best you can do, short of storing your own street locations in a database. The main drawback is that, in order for it to work, the address must have a streetview image. So if you are mostly concerned with rural addresses, it might not work for you.
Upvotes: 1