[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 855
  • Last Modified:

this website needs a different google maps api key

Hello,
I have an application that uses a Google api key to load a map.  I already have an API key, however, I'm getting a popup alert that tells me i need a new API key as follows: "this website needs a different google maps api key. " 

My code is as follows:
--------------
  <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAlvXTXirLwHOAUAbh9-o8FRQI-BQMnXINec8zTxOlEi2KX90_rRSs-MmEVhvKPN2L5yvAK3eNbVwvYA" type="text/javascript"></script>
 
    <script src="http://serverapi.arcgisonline.com/jsapi/gmaps/?v=1.1" type="text/javascript" ></script>

    <script type="text/javascript">
    var map = null;
    var parcelQueryTask = null;
    var parcelQuery = null;
    var mapExtension;
    var gOverlays;


    function LoadMap() {

      //Load Google Maps
      map = new GMap2(document.getElementById("mymap"));

      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      map.setCenter(new GLatLng(29.828135, -95.335922), 8);
      map.enableScrollWheelZoom();
      map.addMapType(G_PHYSICAL_MAP);
      map.setMapType(G_PHYSICAL_MAP);      

 

     
      //create mapextension class to be used to add/remove results from the map.
      mapExtension = new esri.arcgis.gmaps.MapExtension(map);

      //create mapOptions to specify opacity, minResolution, maxResolution when adding to the map.
      var mapOptions = {opacity: 0.75, minResolution:0, maxResolution: 19};

      //create custom tile layer
      var tiledmap = new esri.arcgis.gmaps.TiledMapServiceLayer("http://webgis2.h-gac.com/ArcGIS/rest/services/Lamberts/lamberts_tiles/MapServer", mapOptions, addTiledMap);

      //Build ArcGIS Server Query Task and Filter against the Tile Layer
      tileQueryTask = new esri.arcgis.gmaps.QueryTask("http://webgis2.h-gac.com/ArcGIS/rest/services/Lamberts/lamberts_tiles/MapServer/0");

      tileQuery = new esri.arcgis.gmaps.Query();
      tileQuery.returnGeometry = true;
      tileQuery.outFields = ["LAMBERT","Download"];


      GEvent.addListener(map, "click", function(marker, point) {
        if(!marker){
          mapExtension.removeFromMap(gOverlays);
          gOverlays=null;
          tileQuery.queryGeometry = point;
          tileQueryTask.execute(tileQuery, false, addResults);
        }
      });
    }

    function addTiledMap(gTileLayer) {
      //Add tile layer as a GTileLayerOverlay using mapExtension
      mapExtension.addToMap(gTileLayer);
    }


    function addResults(fset) {

      var overlayOptions = {
        strokeColor:"#FF0000",
        strokeWeight:3,
        strokeOpacity:0.75,
        fillColor:"#000066",
        fillOpacity:0.4
      };

      gOverlays = mapExtension.addToMap(fset,overlayOptions,null);

  }

  </script>

<body onload="LoadMap()"  onunload="GUnload()">

---------
 ANY help in either updating the key or getting this alert mssg off so that it does not popup when the page loads would be greatly appreciated.


0
Codeaddict7423
Asked:
Codeaddict7423
1 Solution
 
mattibuttCommented:
try generating a new key
0
 
chilternPCCommented:
each key is created for a particular URL (even aliass)
I had the probrem when I used the key on a .com when I created it for .co.uk even thought the .com was an alias.
go back to google and create anothe key for the site you have the map on
0
 
kostantinos1995Commented:
Hey, try using version 3 of google maps it requires no api key.
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now