WordPress.org

Ready to get started?Download WordPress

Forums

Basic Google Maps Placemarks
Use of Styled Maps (7 posts)

  1. gruhn
    Member
    Posted 1 year ago #

    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/

  2. Ian Dunn
    Member
    Plugin Author

    Posted 1 year ago #

    Hey gruhn, thanks for sharing that :)

  3. faddadaniele
    Member
    Posted 1 year ago #

    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!
    :)

  4. jgme
    Member
    Posted 1 year ago #

    stamen maps is based on openstreetmap and
    Basic Google Maps Placemarks is based on Google Maps. So it won't work! :-(

  5. faddadaniele
    Member
    Posted 1 year ago #

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

  6. madelinebaum
    Member
    Posted 1 year ago #

    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!

  7. musifilms
    Member
    Posted 1 year ago #

    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 !

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.