Display google map with boundary lines for each address - google-maps

I am working on Google MAP API integration and I have tried to display the map with boundary lines for each addresses like Zillow.com.
Eg: http://www.zillow.com/homes/for_sale/priced_sort/25.945776,-80.147139,25.9432,-80.152374_rect/17_zm/
Zillow gives a neighborhood api/db files with boundaries and I'm not able to make sense of it exactly. How to get map view like their view with the DB data.
I have addresses with latitude/longitude. Using these addresses and latitude/longitude can I draw the boundary line for each address? If the address specifies a building then it needs to display it with its boundary line. Is there any API from google MAP or third party?
Please give me suggestion on this - I went through google search results and related articles on this and couldn't get any result.

Related

Google Directions API Result is different from Google Maps result

I am developing an app that displays the Distance & path between 2 distances. In this case I have used following addresses:
Source: Major Bhola Ram Enclave
Destination: Ring Road Mall, Sector 3, Rohini, New Delhi, Delhi
When I use Directions API then I get following result, see image below:
But, when I search these addresses in Google Maps then I get different Result.
Click here to see Google Maps result
I searched a lot about this but I couldn't find any reason/solution for this.
Please guid me in right direction.
Thanks.
Those are not addresses, they are places. If you want a similar result to Google Maps, you need to use the placeId or the coordinates returned for that place from the places service in the directions request.
http://www.geocodezip.com/v3_example_geo2.asp?addr1=Major%20Bhola%20Ram%20Enclave&addr2=Ring%20Road%20Mall,%20Sector%203,%20Rohini,%20New%20Delhi,%20Delhi&place=1&place=2
(uses the results from the place service)

Google Map API for addesses search

I have been searching for some information on what I want to achieve but not getting any clear answers.
I have a database with thousands of addresses. I want that when the user searches by entering a postcode, the search should show all the available addresses close to the postcode in a map. Zooming In would obviously show closer address to the search postcode (and hence less search results) and zooming out would also include farther addresses (and hence more search results). And then clicking the location icon would display the complete address.
Do I need to store the addresses as longitude and latitude or google map can search a location using postcode? If I need to store the longitude and latitude then whats the best way to convert an address to long and lat?
I really appreciate if you can point me to any useful links or reusable code.
Thanks
As I understand it, you want to find all closest locations from YOUR data to some location, which is identified by a postcode.
First, you have to convert all your addresses to coordinates (Latitude and Longitude). You can do that using Google Geocode API, you will have to create as script, which calls Google Geocode API for every single address in your db:
https://maps.googleapis.com/maps/api/geocode/json?address=EXAMPLE_ADDRES&key=YOUR_API_KEY
The response this script brings you is documented here. You can parse it to get latitude and longitude for each locations and store them in your database. BEWARE of limitations of the Google Geocode API. They are listed here. You have to create your script in a way that won't exceed those limits. Also read this article for caching the results of geocoding, to make sure you don't violate the terms of service. The article also contains some best practices and examples of server side geocoding.
Now, when somebody inputs postcode to your application, you can use the geocoding API or Google maps Geocoding service to translate postcode to coordinate and using haversine formula you can calculate the closest locations from your db, to coordinates of the postcode location. You can do that on frontend side, example in this SO answer (instead of address you will input postcode + state/country in the address bar) or on backend side, if you use MySQL check this SO question.

Generate Google map link with nearby restaurants

Is there a way to generate a google map link which takes in lat , long values and shows me the place along with the nearby restaurants. Using the places API i get the required response but i get that in JSON format i require a link where you click and it opens up the google maps and shows your respective location and all the nearby restaurants.
If you use this link
http://maps.google.com/?q=lat,long it would show me the location corresponding to the lat,long along with that can i also pass in some parameter to locate the nearby restaurants as well something like http://maps.google.com/?q=lat,lng&nearBy=restaurant
If it can be of help to anyone who is facing a similar problem as i was. Found out a way to generate a google link which points to the google maps with nearby restaurants(any field you want to search for can be replaced with the restaurant string)
http://www.google.com/maps/search/restaurant/#your_latitude,your_longitude,17z
You can replace the /restaurant/ with /bank/ and get the nearby banks to the latitude,longitude specified in the link
http://www.google.com/maps/search/bank/#your_latitude,your_longitude,17z
17 is the zoom level you can change that as per your requirement.

Google Maps Store Locator Search field for embedded map

I've embedded a map on a clients site, with their various store locations, using the google saved maps technique: http://passportal.com.au/stockists So basically I don't want store the marker locations in a database, I'm just interested in using the marker positions on the saved map as seen in this demo: http://maps.google.com/help/maps/getmaps/plot-multi.html
I've seen it on plenty of sites and am wondering if there is an easy way to add a search field to find the closest marker to the users address. Something like this: http://www.victoriantextiles.com.au/store-locator
The closest I could find was a google gadget that allows you to type in directions: http://www.google.com/ig/directory?synd=open&hl=en&gl=en&url=http://igwidgets.com/lig/gw/f/islk/89/slkm/ik/s/1329844/87/charles447/google-maps-driving-directions.xml
Any help would be great, thanks!
For this purpose, I use Google Maps API Distance Matrix where I would pass in one origin - user's location and multiple destinations - our dealers. Then I sort the results by distance and take 3 closest to display in a list. Works pretty fast, however, I don't know how you'd achieve this without having some sort of database of your store addresses.

How can I automatically plot markers for addresses on a Google or OpenStreetMap?

I have a list of UK addresses and would like to plot them on a google or openstreetmap (I dont mind which).
Is there a way to render a batch of addresses on a map with dots to represent the location (rather then the standard marker).
To make things slightly more complex, I would like to change the colour and size of some markers.
The data source is a street address including postcode and a marker type (size, color).
Does anyone know of a site, script, process to achieve this?
The geographic region will be a suburb so it is quite a small area.
You can use the Google Geocoding service to spin through your addresses and translate them to latitude/longitude values that you can plot on a map. You make HTTP requests to http://maps.googleapis.com/maps/api/geocode to get back JSON (or XML) responses with the data you need.
Once you have geocoded all your addresses you can use the standard Google Maps API to create render your locations as markers on a map. You can customize the look of your markers by specifying the appropriate options when you create your google.maps.marker objects.