Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 851
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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