pittss / goMap

jQuery plugin for google maps api v3
http://www.pittss.lv/jquery/gomap/
32 stars 10 forks source link

styles option ? #14

Open dhenriet opened 9 years ago

dhenriet commented 9 years ago

Hi,

I can't find how to add a google map style in goMap function ?

In google map API you can set styles in your options

varposition = new google.maps.LatLng(50.9406645, 6.9599115);
var options = {
    center: position,
    disableDefaultUI: true,
    zoom: 2, // initial was 10
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    styles: [{"featureType":"water","stylers":[{"color":"#46bcec"},{"visibility":"on"}]},{"featureType":"landscape","stylers":[{"color":"#f2f2f2"}]},{"featureType":"road","stylers":[{"saturation":-100},{"lightness":45}]},{"featureType":"road.highway","stylers":[{"visibility":"simplified"}]},{"featureType":"road.arterial","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"color":"#444444"}]},{"featureType":"transit","stylers":[{"visibility":"off"}]},{"featureType":"poi","stylers":[{"visibility":"off"}]}]
};

this doesn't work :

$("#annoncements-map").goMap({
     address: 'Paris, France',
     zoom: 11,
     maptype: 'ROAD',
     styles: [{"featureType":"water","stylers":[{"color":"#46bcec"},{"visibility":"on"}]},{"featureType":"landscape","stylers":[{"color":"#f2f2f2"}]},{"featureType":"road","stylers":[{"saturation":-100},{"lightness":45}]},{"featureType":"road.highway","stylers":[{"visibility":"simplified"}]},{"featureType":"road.arterial","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"color":"#444444"}]},{"featureType":"transit","stylers":[{"visibility":"off"}]},{"featureType":"poi","stylers":[{"visibility":"off"}]}]
});

and I have no errors

koktaildotcom commented 8 years ago

Add it in the array: @line 134 var myOptions = {

styles: opts.styles