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 7987861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:16:08+00:00 2026-06-04T12:16:08+00:00

This is the code i’m using in my page to display maps with pointers

  • 0

This is the code i’m using in my page to display maps with pointers database as latitude and longitude.

This Code displays the normal image as represented in the google maps, But as i need the grayscale map, itried it with the google api and got the JSON code but im worried, how to use up the json code that the map displays in Greyscale.

This is the script present in my page:- below this is the JSON code from Google maps

<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAfJRXkzFVohAp-Okxjr5B7xR_ljEFASla9K2hAbTooXc5TaM12hShF8opt9JtUXJpFbuViIHs05-CNg" type="text/javascript">
</script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
    if (GBrowserIsCompatible()) {
        var latitude = <?php echo $store_details->latitude; ?>; 
        var longitude = <?php echo $store_details->longitude; ?>;                                   
        var map = new GMap2(document.getElementById("map"));
        map.setCenter(new GLatLng(latitude,longitude),13);          
        var marker = new GMarker(new GLatLng(latitude,longitude));
        map.addOverlay(marker); 

    }
}); 
//]]>
</script>

This is the JSON code:

[ { stylers: [ { saturation: -100 }, { visibility: "on" } ] } ]
  • 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-04T12:16:10+00:00Added an answer on June 4, 2026 at 12:16 pm

    You are using Version 2 of the API, which does not have styled maps. You need to use Version 3 to make that functionality available. Version 3 is quite different from Version 2. New projects should definitely use Version 3, and Version 2 projects will stop working in May 2013.

    Greyscale map adapted from Google’s rather garish example:

    <!DOCTYPE html>
    <html> 
    <head>
    <title>Google Maps JavaScript API v3 Example: Styled MapTypes</title>
    <link href="/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>  
    <script>
    
    var map;
    var brooklyn = new google.maps.LatLng(40.6743890, -73.9455);
    
    var MY_MAPTYPE_ID = 'Greyscale';
    
    function initialize() {
    
      var graystyle = [
        {
          featureType: "all",
          elementType: "all",
          stylers: [ { saturation: -100 }, { visibility: "on" } ]
        }
      ];
    
      var mapOptions = {
        zoom: 12,
        center: brooklyn,
        mapTypeControlOptions: {
           mapTypeIds: [google.maps.MapTypeId.ROADMAP, MY_MAPTYPE_ID]
        },
        mapTypeId: MY_MAPTYPE_ID
      };
    
      map = new google.maps.Map(document.getElementById("map_canvas"),
          mapOptions);
    
      var styledMapOptions = {
        name: "Greyscale"
      };
    
      var grayMapType = new google.maps.StyledMapType(graystyle, styledMapOptions);
    
      map.mapTypes.set(MY_MAPTYPE_ID, grayMapType);
    }
    </script> 
    </head> 
    <body onload="initialize()"> 
      <div id="map_canvas" style="width: 640px; height: 480px;"></div> 
    </body> 
    </html> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code displays hello in chinese char buffer[10]=hello; AfxMessageBox((LPCTSTR)buffer); while this code displays it
This code works properly in my localhost. I am using xampp 1.7.3. but when
This code i put it in the HTML page for check the file value,
This code is C/C++ and runs without warnings or debug messages. I'm using Code::blocks
This code should save am uiimage to core data. The image is stored in
This Code: Something = new Guid() is returning: 00000000-0000-0000-0000-000000000000 all the time and I
This code gives me an empty result. I expect it to print out the
This code attempts to dynamically switch the class of the StateContainer div from StateOne
This code snippet is from C# in Depth static bool AreReferencesEqual<T>(T first, T second)
This code basically translates characters based on position in one string to the character

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.