D
D
DISERGSLU2016-03-27 12:58:29
JavaScript
DISERGSLU, 2016-03-27 12:58:29

How to style google maps using Gmap js?

Hello.
Created a map using Gmap JS:

(function($) {

  var map;
  
  $(document).ready(function(){
    prettyPrint();
    map = new GMaps({
      div: '#map',
      lat: 43.591655,
      lng: 39.715146
    });

    map.addMarker({
      lat: 43.591655,
      lng: 39.715146,
      title: 'Тест',
}
  }
})
});
})(jQuery);

How to add a design code generated here to the map
[
  {
    "featureType": "water",
    "elementType": "geometry",
    "stylers": [
      { "visibility": "on" },
      { "color": "#2c5278" }
    ]
  },{
    "featureType": "water",
    "elementType": "labels.text.fill",
    "stylers": [
      { "color": "#251725" }
    ]
  },{
  }
]

A similar question has already been asked How to implement google maps + gmaps.js color scheme?
I didn't see a solution there.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SerzN1, 2016-03-31
@SerzN1

var map = new GMaps({
      div: '#map',
      lat: 43.591655,
      lng: 39.715146
    });

map.set('styles', stylesArray);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question