Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hiding google map floor plans

When using Google Map API v3 and using the styled map type I can't manage to hide the floor plans that appear when zoomed in. There are a number of "MapTypeStyleFeatureType" options, none of which help to hide the floor plans.

https://developers.google.com/maps/documentation/javascript/reference#MapTypeStyleFeatureType

The API v3 documentation doesn't seem to include anything about the floor plans. Just to be clear, this is an example of a floor plan:

http://maps.googleapis.com/maps/api/staticmap?center=51.496643,-0.172192&zoom=18&format=png&sensor=false&size=640x480&maptype=roadmap&style=feature:administrative|visibility:off

Any help or pointers would be appreciated.

Thanks, Jon.

like image 702
user1943645 Avatar asked Jan 02 '13 18:01

user1943645


People also ask

How do you hide buildings on Google Maps?

To hide buildings, you need set "visibility": "simplified" globally before adding any specific styles. You can then go back and set the visibility to "on" and add additional styles back in for each element. Seems like the API should have a method for controlling buildings, but it appears they currently do not.

Can you hide things on Google Maps?

Note: You can also edit your saved places in this window by selecting the “Lists” tab. Unlike Labels, you can hide your saved pins by clicking the three vertical dots and selecting “Hide on your map.”

How do I hide categories on Google Maps?

Thank you for getting back to us on this. To hide the Marker Category item, you will need to go to Maps->Settings->Marker Listing and then if you look in the options you will see the option to – Hide the Category column.

Can you hide UI in Google Maps?

We can disable the default UI controls provided by Google Maps simply by making the disableDefaultUI value true in the map options.


2 Answers

ok after a bit more experimentation, here's what I settled with.... set all colours to grey (or whatever colour you want the floor plans to be) in the first style, then re-colour everything you want in the following styles. This results in the floor plans appearing as a single block of colour.

var styles = [
        {
            featureType: "all",
            stylers: [
                { color: "#505050" }
            ]
        },
        {
            featureType: "road",
            elementType: "geometry",
            stylers: [
                { visibility: "simplified" },
                { color: '#505050' }
            ]
        },
        {
            featureType: "all",
            elementType: "labels",
            stylers: [
                { visibility: "off" }
            ]
        },
        {
            featureType: "administrative",
            stylers: [
                { visibility: "off" }
            ]
        },
        {
            featureType: "transit",
            stylers: [
                { visibility: "off" }
            ]
        },
        {
            featureType: "poi",
            stylers: [
                { visibility: "off" }
            ]
        },
        {
            featureType: "landscape",
            stylers: [
                { color: '#FF0000' }
            ]
        },
        {
            featureType: "landscape.man_made",
            stylers: [
                { color: '#393939' }
            ]
        },
        {
            featureType: "landscape.natural",
            stylers: [
                { color: '#393939' }
            ]
        },
        {
            featureType: "water",
            stylers: [
                { color: '#252525' }
            ]
        }
    ];
like image 128
user1943645 Avatar answered Nov 16 '22 11:11

user1943645


It seems like the "All" option is the only thing that will turn off the labels:

http://maps.googleapis.com/maps/api/staticmap?center=51.496643,-0.172192&zoom=18&format=png&sensor=false&size=640x480&maptype=roadmap&style=feature:all|element:labels|visibility:off

Although poi.attraction does seem to turn off the name of the museum, just not the floorplan

http://maps.googleapis.com/maps/api/staticmap?center=51.496643,-0.172192&zoom=18&format=png&sensor=false&size=640x480&maptype=roadmap&style=feature:poi.attraction|element:labels|visibility:off

like image 44
javram Avatar answered Nov 16 '22 12:11

javram