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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:08:11+00:00 2026-05-23T09:08:11+00:00

This is my code : <script type=text/javascript src=http://maps.google.com/maps/api/js?sensor=true></script> <script type=text/javascript> function load() { if

  • 0

This is my code :

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>     
<script type="text/javascript">
    function load() {
        if (GBrowserIsCompatible()) {
            var map;
            var location = new google.maps.LatLng(46.084989, 11.118851);

            var stylez =
            [
              {
                  featureType: "all",
                  elementType: "all",
                  stylers: [
                  { saturation: -98 }
                ]
              }
            ];

            var mapOptions = {
                zoom: 11,
                center: location,
                mapTypeControlOptions: {
                    mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'myScale']
                }
            };

            map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
            var mapType = new google.maps.StyledMapType(stylez, { name: "Grayscale" });
            map.mapTypes.set('myScale', mapType);
            map.setMapTypeId('myScale')        
        }
    }

    $(document).ready(function(){
        load();
    });
</script>


<div id="map_canvas" style="width: 100%; height: 700px"></div>

but nothing is loaded. Where am I wrong? Removing GBrowserIsCompatible() it works, but it doesn’t recognize the location.

  • 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-05-23T09:08:12+00:00Added an answer on May 23, 2026 at 9:08 am

    Map API V2 is deprecated use V3. If you remove GBrowserIsCompatible() it will work and the map will be centered at your desired coordinates.

    To highlight better the location you could use a marker

    var marker = new google.maps.Marker({
        position: location,
        map: map,
        title:"My location title"
    }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this java code: <script src=http://www.google.com/jsapi></script> <script type=text/javascript> google.load(jquery, 1.2.6); $(a#more).click(function() { $(#info_box).show(blind,
From the Flattr Javascript API description : <script type=text/javascript> <!--//--><![CDATA[//><!-- (function() { var s
Below is the code for my YWA wrapper var astr_ywascript = (document.createElement(script).type = text/javascript).src
So I have a URL like: http://maps.googleapis.com/maps/api/geocode/json?&sensor=false&address=1330+SW%203rd%20Ave,%20Portland,%20OR But it returns just JSON. Im looking
I pasted the code given in this link to a file called md5.js. http://www.webtoolkit.info/javascript-md5.html
i'm checking out some newbie Google Maps API tutorial code. They have an example
With this code I can show an animated gif while the server script is
I have a greasemonkey user script with this single line of code... window.close(); but
This code always works, even in different browsers: function fooCheck() { alert(internalFoo()); // We
Unfortunately, this may not be a valid Code-Golf question as it is likely Javascript

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.