Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8828545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:37:51+00:00 2026-06-14T07:37:51+00:00

I have added one additional style to a Google Map, following Google’s instructions .

  • 0

I have added one additional style to a Google Map, following Google’s instructions.
However I have had no sucess adding more than one style. Can this be achieved? If so, how?
Here is an example: http://jsfiddle.net/mikegoodstadt/A9zwa/3/
Many thanks for any suggestions,
Mike

  var geocoder;
  var map;
  var MAPTYPE_1;
  var MAPTYPE_2;

  function initialize() {
    geocoder = new google.maps.Geocoder();
    var latlngLondon = new google.maps.LatLng(51.507335, -0.127683);
    var latlngMarrakech = new google.maps.LatLng(34.02590, -6.83640);

    var style1 = [
     {
       "stylers": [
         { "visibility": "on" },
         { "weight": 0.9 },
         { "gamma": 0.99 },
         { "lightness": -4 },
         { "hue": "#ffc300" },
         { "saturation": -14 }
       ]
     }
    ];
    var style2 = [
     {
       "stylers": [
         { "visibility": "on" },
         { "weight": 0.9 },
         { "gamma": 0.99 },
         { "lightness": -4 },
         { "hue": "#ff6e00" },
         { "saturation": -14 }
       ]
     }
    ];

    var mapOptions = {
      zoom: 12,
      center: latlngLondon,
      mapTypeControl: 1,
      panControl: 0,
      streetViewControl: 0,
      zoomControl: 0,
      mapTypeControlOptions: {
        mapTypeIds: [google.maps.MapTypeId.ROADMAP, MAPTYPE_1, MAPTYPE_2]
      },
    };

    map = new google.maps.Map(document.getElementById('map_canvas'),
        mapOptions);

    var mapType1 = new google.maps.StyledMapType(style1, {name: 'London'});
    var mapType2 = new google.maps.StyledMapType(style2, {name: 'Marrakech'});

    map.mapTypes.set(MAPTYPE_1, mapType1);
    map.mapTypes.set(MAPTYPE_2, mapType2);


  }

  function codeAddress() {
    var address = document.getElementById("search-address").value;
    geocoder.geocode( { 'address': address}, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        map.setCenter(results[0].geometry.location);
        var marker = new google.maps.Marker({
            map: map,
            position: results[0].geometry.location
        });
      } else {
        alert("Buscedad sin exito: " + status);
      }
    });
  }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:37:53+00:00Added an answer on June 14, 2026 at 7:37 am

    You need to declare/set the setMapTypeIDs

     map.mapTypes.set('MAPTYPE_1', mapType1);
     map.setMapTypeId('MAPTYPE_1');
    
     map.mapTypes.set('MAPTYPE_2', mapType2);
     map.setMapTypeId('MAPTYPE_2');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have added eth0:1 with one more ip to the interface file of my
I have added one view controller to my first view controller as aa subview
I have one ViewController, in this i have added one Custom UIView named as
am using the application in this link http://www.jeasyui.com/tutorial/app/crud2.php .I have added one more column
I created one linear layout and I have added two relative layout. I wish
In one of the iPad Application, I am working I have added custom views
I have an existing project that consumes web services. One was added as a
I have one main project and another project which is added as a subprojects.
I have IIS 7.5 With one web site I added new virtual directory and
I have a client who has one webpage with customized routes added in global.asax

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.