Geo Map with pinning location - google-maps-api-3

I am showing world map on dashboard where few locations needs to shown as highlighted. I need to highlight few locations on map based on airport code. For example, IAD is airport code for Dallas, So if a data-center having IAD in its name then Dallas will be highlighted on Map.
Till yet, I tried leaflet.js an open source geo map library. but it requires coordinates to pin a location. I want something like google map (can't use google API as paid tool) where you may pin a location by its name.
If somebody could suggest a library or a heads-up towards how to achieve it, It would be appreciated.

If you are using Leaflet, you will need lat-lng coordinates no matter what.
If you only have placenames, then you'll have to run a geocoding query to convert the addesss/placename into lat-lng coordinates. You might want to start your search in the list of geocoding plugins for Leaflet.

Related

How to get Advanced Data Sets for only one gps point

I started exploring HERE maps few days back and I want to get road specify data (tunnel, bridge, overpass, underpass, speed limit) like the one returned using "Fleet Telematics Advanced Data Sets" after using specific layer. I see that this returns list of all the points that belong to particular tile.
But just want to for gps points that my path has and not on an area. Is it possible using any HERE maps api or any manipulations to the above API or any other WAR?
It is not possible to get road geometry for a single gps point buut rather for the link/road in which the gps point is. If you want to find get road geometry details for the links/roads of a particular route you can get it by using Fleet Telematics API. Adding "attributes=ROAD_GEOM_FCn(TUNNEL,BRIDGE)" can fetch you the details whether the road is a tunnel or a bridge etc. Hope this helps!
http://cre.cit.api.here.com/2/calculateroute.json?app_id=xxxx&app_code=xxxx&mode=fastest;truck;traffic:disabled&driver_cost=10&waypoint0=55.308989,10.805059&waypoint1=55.368920,11.288338&attributes=ROAD_GEOM_FCn(TUNNEL,BRIDGE)

showing districts limited areas by polygon in google map in R [duplicate]

If I search a query in google maps for example "carlton victoria australia" then it will give me a map of the region with the border around that area.
My questions are:
Is there a way to get list of all regions from the google map api for
certain province or country?
Can I combine the region information for example, change the color and also add some infowindow on top of the region?
What kind of level of the region that I can get from the api (district, subdistrict, village)?
Currently Google Maps JavaScript API doesn't expose any boundaries of geographic features. There is very old feature request in the public issue tracker to add this functionality, however it looks like Google didn't set high priority on this:
https://issuetracker.google.com/issues/35816953
Feel free to star the public feature request to express your interest and subscribe to further updates from Google.
You can get polygons from other sources and add them to Google maps as additional layers.
The nice workaround to get polygons in GeoJSON format from OpenStreetMap is described in the following answer:
https://stackoverflow.com/a/40172098/5140781
So, if you download the GeoJSON you will be able to add it to map using the data layer and its loadGeoJson() method:
https://developers.google.com/maps/documentation/javascript/datalayer#load_geojson
You can style colors of GeoJSON objects and create info windows. Just read the aforementioned documentation.
I hope this helps!

Google Maps API - Get accurate coordinates with business/building name.

I am developing a website in ASP.NET in which I need accurate coordinates of properties and populate their markers on Google Maps. I read the Google Maps API documentation and it doesn't accept business names or house numbers. So if I add 5 properties on Moseley Road with postal code WR2 6NJ, they all receive the same coordinates at the beginning of the road, where as they're all separate properties with separate coordinates, for example: Arthur Amos Associates Ltd, Moseley Farms etc.
How can I increase the accuracy so each address gets it's own coordinates? I tried the ROOFTOP and street_address parameters but they didn't help. Do I need to get Google Maps API for Work to get this level of accuracy?
Thanks.

Google Earth Pro Alternatives

Is there any alternate free application like Google Earth Pro ? , My main thing is it should import shape files as a layer in the map.
Depends upon what you are looking for. If you really just want to see the shapefile, use something like qgis or udig.
If you want to see the shapefile on top of a street map or a satellite base layer, I am not sure there is something that will work for you out of the box. Open Street Map has the data; a service like http://www.osm974.re/osm2gis/ can export a limited area of Open Street Map data as a shapefile.
You might want to peruse this page from the Open Street Map wiki: http://wiki.openstreetmap.org/wiki/Shapefiles
There's this open source application called "Marble" that works ok...but unfortunately you can't load shapefiles into it. You have to convert your shapefiles into wkt with qgis or something before loading them in. The satellite imagery is so pathetic as to be considered nonexistent. But its faster than Google Earth Pro that's for sure, and you can use OpenStreetMap to get a pretty good vector scaled experience to see where you are.
http://marble.kde.org/index.php

Highlighting borders of state and cities of US in Google Map API 3

I have a scenario where I have to highlight borders and shade a state or city after geocoding it (when I got the lang and lat).
How can I do this, do I need to have a complete information of a city to surround it with polylines? Or is there a way that map API can do this for me.
True. Google does not provide this feature. So what we can do... we can have the lat/long of the borders of the state. And we have to draw polygons ourselves.
I used this JS object. And changed it to Google map object (google.maps.LatLng).
For example:
var statesobj = {"AK": [new google.maps.LatLng(70.0187, -141.0205),
new google.maps.LatLng(70.1292, -141.7291),
new google.maps.LatLng(70.4515, -144.8163)]}
So, it's easy now. Loop on these lat/longs. And you can draw the polygons on every state of US.
So this is the solution I came up. If you guys know some better idea to do it. Please share.
You can also try Google Geo Charts:
http://code.google.com/apis/chart/interactive/docs/gallery/geochart.html
Google Maps API doesn't allow you to retrieve city borders. There are a couple other places from which you can get the coordinates, though:
Flickr API
There is a Flickr API based on photos that people tag, but it's only as accurate as the people who tag photos: so it's good enough for bootstrapping but probably not for production: http://karya-blog.blogspot.com/2012/12/fetching-city-polygons-with-flickr-api.html
Natural Earth Data
An accurate alternative is www.naturalearthdata.com. To get that data from there you just need to make two requests: one with the city name and one with their ID to get the parameters:
unlock.edina.ac.uk/ws/search?name=berlin&gazetteer=naturalearth&format=json
and then
unlock.edina.ac.uk/ws/footprintLookup?format=json&identifier=14126951
and you're set :)
Mapzen
If it's possible for you to pre-fetch the data, go for Mapzen, they have a full and pretty accurate database: https://mapzen.com/data/borders/
I'm afraid google maps API doesn't provide any means to access region (country, state, city, ...) shapes.
If you want to highlight regions you have to create custom overlays based on data acquired elsewhere.
Now the basic map example includes a "mashup" of data. When identifying data is fed to the web service, the resulting output can pinpoint locations on the map.
It shows how a geographic Map Marker is placed on the map to identify a specific location. Map Markers can use the default icon (shown) or a custom image, gauge, or even a chart. Optionally, the map can be configured to display a Map Marker Info window, containing additional location-specific data, when the marker is clicked.
It includes data-driven, colored regions (in this case, representing postal codes) overlaid a map of eg Washington, DC. Logi Info can work with GIS boundary data to produce region overlays for states, counties, cities, school districts, and other areas. Like the Map Marker, regions can be clicked to display a pop-up information window with detail data.

Resources