I've seen a score of questions/answers on how to hide poi.business icons/labels from google maps, but what I need is for them to show up persistently across zoom levels. For example, even when I have featureType poi.business styler visibility set to "on", the icon shows up in ROADMAP type but not on the same HYBRID map counterpart. I need the icons/labels to show up on both map types at the same zoom level.
I've tried this with both the google maps API v3 as well as the static map URL formulation and the same problem shows up. It appears the server determines that at certain zoom levels of the HYBRID map certain icons/labels should be hidden. I would like to override this decision. Is there a mechanism for this? (On the HYBRID map, if I haven't been clear.)
Thanks!
It seems no, at least for icon. From google docs MapOptions object specification:
styles | Array. | Styles to apply to each of the default map types. Note that for Satellite/Hybrid and Terrain modes, these styles will only apply to labels and geometry.
Related
I was wondering if you could put a custom StreetView with a marker. I am making a map that has city parks. I want it so if someone clicks on a specific marker, the custom StreetView pops up and shows the panorama. For the custom StreetViews I used Google Views. Is this possible?
Thanks in advance.
Yes, this is possible. Something close to it can be done in two ways.
The easiest option is to load Google maps from the main URL and wait. It will let you build a map or view your custom maps just below the search bar. Google Maps itself lets you create a custom map with markers. This doesn't sound like your desired option, but it is quick to implement. You can even add your own style.
The second is to create your own custom Street View tour, this sounds like your focus. You want the actual panographs to use your markers. This is fairly easy to do, but requires some programming. It is possible on both Google Earth and Google Maps. Check out the Google APIs such as https://developers.google.com/maps/documentation/javascript/reference#StreetViewPanoramaOptions. Options include changing out panographs for your own images, defining arrows including labels, overlays, pop-up boxes, action boxes, and more. Check out some options here: http://hpneo.github.io/gmaps/examples.html
I have implemented a map using google map api v3, where users can add a marker dynamically and give their feedback through a form in infowindow which pop-up while adding the marker.
I want to prevent users from adding the marker on ocean/river area.
I have searched solution for this requirement and I got this answer, unfortunately the html5 canvas method explained there was for static map but I need this for dynamic one.
Please help!
For oceans and seas
You can use elevation api as in this example:
Example
For ocenas and sees it will return negative number but:
It's not 100% accurate. For some terrains near water it returns negative numbers
It doesn't work for lakes and rivers
The default overlays that come out of the box for Google Maps API v3 Street, terrain, etc. appear to busy. I want to have a good "night" or "minimal" overlay that is like leaflet night view or minimal view http://leafletjs.com/examples/layers-control.html (select the layer control to switch between views) or a simple white and gray map without all the business of the colors. Are there such overlays that exist or settings that could be used so that I could use it/customize it for my Google Map?
You can create your own style. Here is the documentation
https://developers.google.com/maps/documentation/javascript/styling
Included is a style wizard that generates all the JSON for you
http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html
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)
I have a problem loading the google map custom markers in kmlLayer.
The custom markers become very tiny recently.
http://apdrc.soest.hawaii.edu/gg/rainSD2.php
It was working before. Does anyone know the problem on that?
Is that the google map API server problem?
Does google map API change the setting for custom markers size?
Thanks for helping.
Google announced a change to KML rendering that was scheduled to take place in mid-July. It wouldn't surprise me if this included support of the scale tag. Are your icons not standard sized? Should they be scaled?
Looking at your KML, you are scaling your icons:
<scale>0.25</scale>
If you apply that to your icons which are 32x32, they end up being 8x8, and the dot is already a pretty small chunk of the real estate.
If you change the scale to 1.0, I think it will display as you expect (once the cache on google's servers updates).