How to get hemisphere using google map api - google-maps-api-3

I'm using google map api V3 to set map and to do such mapping related functions. Now I want to know about hemisphere of current location that on which side it is from particular location and need to set marker image accordingly.
I searched about particular function or trick to get hemisphere using google map api but I couldn't get it. Can anyone tell me how can I achieve this?

if latitude is < 0 then coordinate is located on the southern hemisphere, otherwise on the North hemisphere.

Related

Google Map Api - How to know if a coordinates is accessible by pedestrian

I'm trying to figure if there is a way to ask the Google Map Api to know if a random gps coordinates like :
48,277373
2,4883883
Is accessible by pedestrian ?
It should be possible because if I ask Google Map to lead me in the middle of a river, it will lead me just on the nearest point before the water.
But I'm not sure how about I can get this information by providing the coordinates.
Thanks for your help :-)

Geo Map with pinning location

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.

Here map drawing a route from A to B and displaying it even if the start point is in a building

As you can see the path below isn't totally complete.
I would like the path to be drawn from the start point (and not from the closest point in street).
Does anyone know if there is a way with heremap to draw this part ? Or is this just simple not possible ?
I've looked here without success: https://developer.here.com
I believe what you are looking for is to use the navigation position of the POI instead of the centroid location of the POI. By default the position returned of a place is the "center" of the building location, not the entrance location.
The solution:
Place the marker using Location#getAccessPoints() API
For indoor related usage, please also integrate with the 3d Venue APIs to add indoor routing to the app.

Google Map to Search in Polygon Only

I am making a Google Map (API v3) that searches within a given neighborhood. The neighborhood is not a square but a ton of different points to make a polygon bounding box. I know how to make the polygon but not sure how to get it to search only within the polygon. Below you can see I am using a radius from my center location but I don't need a radius but only a given location.
var request = {
location: centerLatlng,
radius: 800,
types: ["school", "church", "park", "university"]
};
I'm guessing this is a places API request?
https://developers.google.com/maps/documentation/javascript/places
The API doesnt support passing in a artbitary polygon. If you really need to search as such, will just have to do a circle search (as in your example) - and then discard and results that are not in your shape.
Dont think there is a 'is point in side polygon' test in the Maps API itself, but can find code online
https://www.google.com/search?q=point+in+polygon

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