Opened 13 years ago

Closed 13 years ago

#27 closed enhancement (fixed)

Upgrade to Google Maps API 3.0

Reported by: bfraser Owned by: theduckylittle
Priority: critical Milestone: 2.6
Component: GeoMOOSE/JS Version: 2.6
Keywords: google Cc:

Description (last modified by bfraser)

OpenLayers has already upgraded; we just need to follow their advice. This will eliminate the requirement for an API key.

When creating OpenLayers.Layer.Google instances, the only difference to the V2 API is the way the layer types are configured:

var gphy = new OpenLayers.Layer.Google(
    "Google Physical",
    {type: google.maps.MapTypeId.TERRAIN}
    // used to be {type: G_PHYSICAL_MAP}
);
var gmap = new OpenLayers.Layer.Google(
    "Google Streets", // the default
    {numZoomLevels: 20}
    // default type, no change needed here
);
var ghyb = new OpenLayers.Layer.Google(
    "Google Hybrid",
    {type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20}
    // used to be {type: G_HYBRID_MAP, numZoomLevels: 20}
);
var gsat = new OpenLayers.Layer.Google(
    "Google Satellite",
    {type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22}
    // used to be {type: G_SATELLITE_MAP, numZoomLevels: 22}
);

Use the following to reference the API:

<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>

Change History (3)

comment:1 by bfraser, 13 years ago

Description: modified (diff)

comment:2 by theduckylittle, 13 years ago

Owner: set to theduckylittle
Status: newaccepted

Yay, code!

comment:3 by theduckylittle, 13 years ago

Resolution: fixed
Status: acceptedclosed

And it's now in trunk.

Note: See TracTickets for help on using tickets.