postcode and kilometer on google map - javascript

I am new to working with google maps. I want to display a map when the user enters a post code and then selects "km". The map should display shops in the selected area, within a kilometer. How can I do this?
See this example.
If you select option 2 from the radio buttons, I want the same behavior. First post code and then select kilometer then search in Google Maps.

I would recommend using the Places API. First, you could use the autocomplete widget with the geocode option on.
And then you could use the places search widget with the location parameter being the result of the autocomplete, and the radius being the number of meters you're interested in having results for.

Related

Google places API - How to get states of US country only and set on drop down?

I want to show US state list in dropdown using goole map api call in javascript but i have not got any proper way to set this please help me.
I want to set US state dropdown and based on state selection i want to show their seleced market counties, associations or Metropolitan Statistical Area (MSA) detail using google api how can we do this ?
I have do lots of reseach but i don't understand using google map how fetch state list of particular cities.
Google places API - How to get regions of a country?

Restrict Search Scope with Search Widget/Geocoder

I've implemented an autocomplete searchbox on the map via the Geocoder. It's working fine. However, I would want to limit the returned results via the Geocoder to city limits.
For example: When a user types in "305 Quincy St", I want it to search for this address only within a city, let's say Florida.
At present, it is looking for this address from all around the world.
Can this be done?
Is it possible to make the autocomplete widget search within a
boundary extent on the map?
The closest I've come across is using the sourceCountry option of the Geocoder options and set it to USA. But it would be awesome if there was a way to have a sourceCity too.
Yes, you have a searchExtent parameter that can be used like this:
searchExtent=-104,35.6,-94.32,41
More info about searchExtent parameter

Is it possible to limit the search of Google Map autocomplete to borough

I have been looking at this documentation of Google Map API.It restricts the user search to a country.
https://developers.google.com/maps/documentation/javascript/reference?hl=sv-SE#ComponentRestrictions
Now, Is it possible to limit the search of Google Map to specific region(borough) of a particular city.I was looking for a demo example to limit my search to specific borough of New York City.E.g if the user has selected Manhattan, then the search should display addresses related to Manhattan.
Yes you can!
In the V3 Google maps API, look for 'locality'. It is under 'component filtering'.
Here is is the link.
https://developers.google.com/maps/documentation/geocoding#ComponentFiltering
You can see the functional example on Google maps by typing in 'Queens, NY' in Google maps search. The light boundary outline on the map is what you are after.
You can see the light pink outline of Queens in this map link.

How do you create custom interactive areas on Google Maps?

I'm trying to create a map that shows county/district areas using Google Maps that will allow users to click on the area to retrieve relevant pop up information.
I have two datasets that I think would help, one being a list of UK Postcodes which would in turn allow me to determine different postal areas and the other is a dataset from Ordance Survey that contains province borders (county/district borders).
I've looked into KML Files and ImageMap but I'm not sure how to create these areas using the data I have?
I'm looking to achieve the sort of map that is used here:
http://content.met.police.uk/Page/YourBorough
Any help is greatly appreciated!
Thanks.
The way to work with Google maps is by using their api closely. You cannot go with simple image mapping.
Try those two links for starters:
https://developers.google.com/maps/documentation/javascript/examples/polygon-simple
and
https://developers.google.com/maps/documentation/javascript/reference#Polygon.
In short - you may need to draw a polygon for every area, bind a click event to it, then show Info Window with the relevant information for the user.
In case you're new to google maps, you may need to take more time inspecting their Api and the examples they give.
Best regards.

Any Javascript API for maps with country-specific display?

Is there any Javascript API that does not display the entire world map and later allows to zoom and click to individual countries, but instead just displays the country we are interested and allows region-level clicks? In other words, I am looking for an API similar to JVectorMap but this does not have comprehensive support for all countries and it does not show street-level view when zooming further deep into state/city level. I hope my requirements are clear. If I am interested only in let's say England's map, I want the map to show just England but allow state and city-level clicks with street-level or near street-level views at the lowest level as an optional feature (not too many details at the lowest-level). Google Maps, jHERE etc. seem to show the entire world map and allow to zoom-in, which is not something I want.
thanks,
Paddy
If you only want the street maps for one country to be visible, you could download the Open Street Map data into a PostGIS database for that country and that country only, and generate tiles. There are several tutorials on how to download data and make tiles, e.g. http://switch2osm.org/serving-tiles/manually-building-a-tile-server/

Categories

Resources