I am exploring Google Maps Javascript API to start our new project. Does anyone know how many layers can be added to Google Maps?
Google Maps API v3 doesn't stack the information as layers. There is a fixed group of layers, and each entity gets pushed into the corresponding layer based on its type.
If you meant overlays, then Google Maps has a layer in particular to add each overlay. I've never loaded that many overlays to make the browser unresponsive, but in general that's the google way. You are free to load thousands of entities of a given type, but it's up to you to decide what's the practical limit to keep browser responsiveness.
10 layers -if you add more you get a message a message to say there are too many layers to display. I haven't discovered yet how many features you can add to a layer
Related
I saw the deprecation message and the blog post by Google and I'm completely stumped on what will continue to work and what not.
I don't upload images to my account. I understand that this service will no longer be available.
What I do use, is this api: http://www.panoramio.com/map/get_panoramas.php, for showing images near locations on my website.
Will I be able to keep using it?
If so, until when? And shouldn't that be clearly stated?
If not, is there a parallel Google Maps api to get such images? I'm aware of Google Locations api, but I'm more interested in nearby outdoors images, and not places of business and named land marks.
Thank you.
UPDATE: as stated in the comment, the service is indeed down. The image urls we already have are still operational for another year, but we can't search for other existing images anymore. So we made the transition to Flickr. It was very easy and it works great.
It is stated in the link that you provide that after November 4, 2016, you’ll continue to have access to your photos in Panoramio for a year, but take note that you will no longer be able to add new photos, likes, or comments.
I suggest you to check this Google Static Maps API, it lets you embed a Google Maps image on your web page without requiring JavaScript or any dynamic page loading. The Google Static Maps API service creates your map based on URL parameters sent through a standard HTTP request and returns the map as an image you can display on your web page.
On an early version of the maps 3 api, I build some "overlay" functionality to do the following using a custom map type - the idea was that as opposed to always serving my tiles on top of google's tiles, I would only show google's tiles when needed - that is either when the tile is outside of my zoom and boundaries or when my tile has transparency (mostly due to the fact that the outside borders of my overlays may follow rivers, etc). It worked like so:
When getTile was called on my type, determine if I should be serving the given tile for the given level.
If I should be serving the tile, determine if the tile had any transparency - if it did, get the tile from the default map using
map.mapTypes.get(google.maps.MapTypeId.ROADMAP).getTile(coord, zoom, ownerDocument)`
then append my image to the top of the returned div and display that. Otherwise, just serve my tile.
If I should not be serving, the tile, just return
map.mapTypes.get(google.maps.MapTypeId.ROADMAP).getTile(coord, zoom, ownerDocument)
So, it seems like due to some thievery, getTile no longer returns anything on google's native map types, which bring up two questions:
Is there any way for me to tell the map that it should be displaying my tile as an overlay as opposed to a full tile without having to have my whole map be an overlay?
Is there any way to tell the map that it should be displaying its own tile as opposed to mine?
The overlay maps work as a solution, but performance is not great, there are quite a few redraws as google first draws its own tiles and then overlays them with mine. Since 99% of my tiles are a complete overlay (no transparency) this seems like quite a waste of bandwidth. It would be great to be able to pass back metadata from getTile indicating whether the default google tile should be drawn at all (or indicate that fact in some other callback). What I had previously seemed like an elegant solution and performed well - the overlay methodology is definitely a step back. Marcelo, I'm not sure how my title does not reflect my question... did you read the complete text of the issue?
You can't access the base map types. It's been intentionally disabled by Google due to ongoing abuse.
At some point this was reported as a bug, but you can read the comments by members of the maps team on this thread:
Quote from that page:
Unfortunately we discovered an increasing number of cases of developrs
using the default map types to gain access to and use Google map tiles
outside of a google.maps.Map object, which is not permitted by the
Terms of Service. We were therefore forced to move the internal map
types to a private registry. If you have specific reasons for needing
access to the map types that are compliant with the Terms of Service,
please update this issue with your use case, and if there is
sufficient demand we will look into whether we can provide a
supportable solution for your requirements.
by Thor Mitchell (Google Employee - Maps Team)
Is there any way to capture the image from a complicated Google Maps with some customize overlays like heat gradient. See figures:
Google static map API can only generate static maps(images) with simple polylines or markers, in my situation this is apparently not enough, I want user to capture this kind of images and share it in there twitter fb of g+
see Google Maps image?, it is a similar question. But not so useful in my situation
It's not allowed. See here:
https://developers.google.com/maps/faq#tos_screenshots
Use of Google Maps imagery in printed materials and offline media is
subject to the Permission Guidelines published at:
http://www.google.com/permissions/geoguidelines.html
you can request permission, but I don't think it's easy to obtain, unless you are a paying business customer.
Are all places delivered by the Google Places API displayed on the Google Maps MapTypeId.ROADMAP by default? That is, I do not need to query the places API and display them on the Google Maps MapTypeId.ROADMAP because by default they already show us a labels?
Nope. The ROADMAP type show many prominent places on the map to help provide context, but they are by no means the entire listing of places that might be found via the Places API for a location.
I'm currently creating an interactive web map using Google Maps Javascript API version 3. I'm not sure if this is possible but I would like to create a series of map layers consisting of different kml files that could be toggled from the side bar. I would also like to be able to access the individual points within the kmls so that when the user clicks on a particular point, photos, text etc. can be loaded outside the map window...
Any ideas on how to accomplish this? I've been searching for a while and only found ways of configuring the infowindow which I personally find unattractive...
There is a way to load KML into a google maps application natively, there is actually a pretty good example of how this is done here:
http://gmaps-samples-v3.googlecode.com/svn/trunk/layers/layers.html
One trick I will mention is that since the KML is downloaded to Google's servers in order to be rendered on the map, it must exist on a public facing web server somewhere, Google won't be able to access it from your local machine.
I found this tutorial which seems like it'll do the trick!