Any Javascript API for maps with country-specific display? - javascript

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/

Related

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.

how can I highlight/select different regions on google map?

I was trying to mark regions on google map for a city (for a small utility webapp, that I am writing). However, when I looked up areas by their name, I noticed something new. There is an outline around the areas. Like this(if you search for: "Koregaon Park, Pune, Maharashtra"):
Is there a way I can extract all these regions for a given city (in this case, Pune, India) ?
Can I add my own regions or edit regions as per my needs ?
In the end, I'd like the user to be able to select multiple regions and I'd like to collect that info, in an array or some other data structure ?
Can someone point me in the right direction on how to do this ?
PS: This is limited to a city for now, and the number of regions that I'm targeting are small in number(say around 10. This number will grow if my experiment proves out to be efficient).
Please dont downvote this. If you need me to provide more info, please do let me know.
You are asking how to display polygons for your cities on a Google Maps API map.
There are at least 3 ways to do that, but for all those you need the coordinates of the polygon.
KmlLayer - need the data as publicly available KML
FusionTablesLayer - if you have the data as KML you can import it into a FusionTable, if it is a .shp file you can use shpescape.com to import it into FusionTables
You can display the polygons as native Google Maps API v3 polygons
There is publicly available KML data in the Natural Earth Data set (which is available in FusionTables) and at http://www.gadm.org/

Google Maps - Get Province outline from Google map

When searching for a Province in Google Maps, it outlines the map and adds a icon on the Province.
How would you get that from google without having to draw it point by point ? Im sure it's available if its showing on their maps.
Here is an example:
Western Cape, South Africa
I do not think it is directly available through the API beyond what you can achieve with the styling wizard
To implement it yourself you'd need to find a shapefile for the areas of interest, store it in a spatially enabled database, (like PostgreSQL/PostGIS), and then load the relevant polygons, which you can style freely. Alternatively you can create a custom tile layer, like this, (check the "density" box), or you may be able to load it using fusion tables, (not an entirely simple process).
See this similar question (doing the same thing for countries)
The answer can be applied to a province rather than a country.
Here is the closest I could come to that styling.

Display own places on custom Google Map

I'd like to create a map of a space system from a computer game.
I understand that you can use the Google Maps API to render your own map with custom tiles and placemarks etc (which I've done successfully), but I'd really like to be able to see hierarchical place names in the same way that you see New York, Brooklyn, Manhatten, Queens etc when viewing New York from this zoom level, and Chinatown, East Village, Hudson Square when viewing New York from this zoom level.
I've also had a look at Google Fusion tables, but they appear to be restricted to Earth locations only.
I suppose ideally I'd like a modified version of the google.map.Marker object that displays the name of the marker next to the marker itself and allows specification of the text-size and at what zoom level the marker text appears. But that feels like a hack.
Is this possible using the Google Maps API, or another browser-based mapping system?
EDIT:
D'oh, should have kept Googling. Someone's basically done what I was looking for here.
Self-answering the question so it doesn't keep coming up as unanswered.
I've used the code from Uncle Tomm's blog to solve the problem.
I just need a good algorithm for displaying nearby placenames without them overlapping... but that's another question!

Google Maps API - How can I enable 'Points of Interest'?

I've seen some sites, that use Google Maps, have the ability to show 'Points of Interest' on the map. Similar to what Google Earth does.
Here's an example of what I'm talking about: http://i.imgur.com/5OCor.jpg
How can I do this? :/
As far as I know, Google Map does not have a 'Points of Interest' feature for you to enable.
But you always can do it on your own. First of all, you have to obtain a POI database, e.g. Open source POI database? - Stack Overflow
Next, select the POIs visible in the viewport. Then add them to the map using GMarker. You also have to add or remove the POI as user pan and zoom the map.
As you can see this requires fair bit of programming. Google Earth has already packaged this into a great application. But this isn't available in Google map API (that I know of).
One possible source of POI data is http://compass.webservius.com - it's a REST API allowing access to a database of millions of businesses in the USA, searchable by business type (industry code), latitude/longitude bounding box, etc.

Categories

Resources