Area/Boundary lat long of a location of a given area - javascript

Suppose I search using a location something like (Texas) now I want to mark the area of Texas using a polygon. So for drawing polygon i need the the lat long of that area. I search in google and discuss with some of my friend i found those links. From those links I understand that google doesn't provide the information.
I need a solution in google map V2 so that i can implement it in my android project. So my question is how can i get those area lat long? Here is some link of my requirement-
Google Maps how to Show city or an Area outline
Outline areas on a Google Map using Google Map API v3
Highlighting borders of state and cities of US in Google Map API 3
And here is some screenshot-
https://drive.google.com/file/d/0B_TUaWwnPSeHbnZlc0hWbzZPcmM/view?usp=sharing
https://drive.google.com/file/d/0B_TUaWwnPSeHWUg2WDdkMUs1TjA/view?usp=sharing

You may want to check out Google's developer guide for Geocoding: https://developers.google.com/maps/documentation/geocoding/intro

Related

Map creation API for fictional interactive maps?

I want to make an interactive map web application for a game that I play. Basically I want it to be a kind of Google maps clone, where I have a vector-based graphic of the region area and I can zoom in and out to reveal certain level of detail.
My research into map APIs has returned little results. OpenStreetMaps and Google Maps only allow custom maps with real geolocation data. My project requires the creation of a map with nonexistent locations. Does anyone have a suggestion on how to approach this? Thanks.
I think you can use "real" GPS coordinates and then customise the base layer beneath. The GPS Lat Long coordinates (between -90 and +90 each) offer as good a scale as any to then locate your fictional positions.
Google Maps has an API that allows putting custom layers and base maps here:
https://developers.google.com/maps/documentation/javascript/maptypes#CustomMapTypes
OpenStreetMaps will also allow this. Some recommended guides available here:
https://switch2osm.org/serving-tiles/
Good luck!

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 I find street segments using the Google Maps API?

In Google Map Maker you can right click on an area and select "Find near this point" which shows a list of every road segment and intersection nearby. Is there any way in the google maps API to retrieve similar information regarding road segments?
I'm working on a simple exercise app and need to know how many blocks I've traveled, not just distance.
No, the Maps API does not offer the ability to query for road features directly.

How to display city limits using google maps API V3

If I do a search for a city or neighbourhood which google recognizes, like Fernwood, Victoria, I get a pretty map with a drawn boundary. Is there any way to access this kind of information with the google maps API?
I am not looking to draw my own lines on maps, I am looking to make a map showing multiple neighbourhoods with limits on the same map. Bonus points for the ability to style these limits (eg: fill them in like a regular polygon)?
I'm pretty sure that this kind of functionality is not supported by the api and works only for google maps.
I had implement this by finding the boundaries that i needed insert them in my postgis db and then send them with json whenever the polygon was within the map viewport.
Hope it helps

Highlighting whole street with some maps API

Is there any way to highlight/display on Google/Bing/(any other map provider) Maps whole street (from the beginning of the street to the end of)?
I know the existence of Polyline in Google Maps API, but it's just connecting two latitude points, and there is no way of making it automatic so I could display any street in some city.
Also I was thinking about Directions, but many street are 2 way, there is no guarante that you will mark whole street and it's just now user friendly. Example
You may want to check Mike Williams' article on how to snap points and polylines to streets with the Google Maps API:
Snap points (and polylines) to street
Especially this example:
Click on the map and a path will be drawn that follows the streets.
Take a look at OpenStreetMap. (Google and Bing won't let you access their underlying street data.)
You can show a map with OSM tiles, and use the API to query for the features you're interested in displaying on the map. OpenLayers is a javascript mapping library that could support this.
Here's a view of Chicago showing street vectors and other features overlaid on top of the map tiles:
http://www.openstreetmap.org/?lat=41.902104&lon=-87.626441&zoom=18&layers=B000FTTT
In Azure Maps you could access the vector tile road layers and use a data driven style based on the name of the road. Here is a tool that inspects the underlying data in the map tiles and highlights things that you click on. This has a lot of the basic functionality that you would need to achieve what you are asking for: https://azuremapscodesamples.azurewebsites.net/?search=inspect&sample=Inspect%20features%20under%20the%20mouse

Categories

Resources