Support » Plugins and Hacks » Basic Google Maps Placemarks » [Plugin: Basic Google Maps Placemarks] Use of Styled Maps

  • Hello everyone,

    I didn’t see anything about the Styled Maps, so I made one brute adaptation of the code, at the functions.js.

    I just replaced the line

    map = new google.maps.Map( bgmp.canvas, mapOptions );

    By

    var styles = [
    				  {
    					"stylers": [
    					  { "hue": "#00ddff" }
    					]
    				  },{
    				  }
    				]
    
    				var styledMap = new google.maps.StyledMapType(styles,{name: "Styled Map"});
    
    				map = new google.maps.Map( bgmp.canvas, mapOptions );
    
    				map.mapTypes.set('map_style', styledMap);
      				map.setMapTypeId('map_style');

    It worked fine, and maybe this could help other users.

    The code that I used, is based on the documentation: https://developers.google.com/maps/documentation/javascript/styling

    PS.: I only tested it in pages with one map.

    Hugs from Brazil.
    @gruhn

    http://wordpress.org/extend/plugins/basic-google-maps-placemarks/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Ian Dunn

    (@iandunn)


    Hey gruhn, thanks for sharing that 🙂

    Hi, first of all, sorry for my english.

    I really like to embed wonderfull stamen maps style into this plugin.

    It seems like to be quiet easy but i’m a noob in coding and I can’t do it, can you help me?

    thanks in advance!
    🙂

    stamen maps is based on openstreetmap and
    Basic Google Maps Placemarks is based on Google Maps. So it won’t work! 🙁

    I read Google Maps is supported (look at the end of the page: Stamen maps. I’m wrong?!

    Hi — I’m trying to use styled maps to suppress labels on points of interest and other features on a map. I tried changing the code as described by gruhn above and it didn’t work. Either the map didn’t load at all, or I just lost my placemarks but didn’t lose the labels. I’m sure I’m doing something wrong — I know just enough CSS to be dangerous. Here’s the code I’m trying to insert:

    [
      {
        "featureType": "poi",
        "stylers": [
          { "visibility": "off" }
        ]
      },{
        "featureType": "transit.station.bus",
        "elementType": "labels",
        "stylers": [
          { "visibility": "off" }
        ]
      },{
      }
    ]

    Thanks in advance for any help you can give me!

    Hi everyone.
    I’m very interesting to customize my google maps, but like Madelinebaum, I don’t know where put the code with this features ?
    I didn’t know Stamen Maps, but it seams like to be more funny than google.

    Is it possible to create some custom code for maps (custom google code or stamen maps in css files or in files of the BGMP) and add this to the option of the Maps Settings (in add of Street Map, Satellites Images, Hybrid and Terrain). It will be more easy to define and change it ?

    thanks for help !

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Basic Google Maps Placemarks] Use of Styled Maps’ is closed to new replies.