Begin work on Google Maps Layer. In order to create this layer, layer div creation has been moved into Layer.js, and the div that is created is then slotted into the right place by the map.addLayer function. (This is so that, at layer creation time, a div is available). However, it seems like Google Maps does not know how large the div is for reasons I don't yet understand, and there'se also the fact that our zoom levels differ from Google's at the moment. But it's getting there.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@29 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-05-13 16:11:52 +00:00
parent 7b62f33544
commit 46035298a5
5 changed files with 62 additions and 2 deletions

View File

@@ -0,0 +1,17 @@
OpenLayers.Layer.Google = Class.create();
OpenLayers.Layer.Google.prototype = Object.extend( new OpenLayers.Layer(), {
// gmap stores the Google Map element
gmap:null,
initialize: function(name) {
OpenLayers.Layer.prototype.initialize.apply(this, [name]);
this.gmap = new GMap2(this.div);
},
moveTo: function() {
center = this.map.getCenter();
this.gmap.setCenter(
new GLatLng(center.lat, center.lon),
this.map.getZoom()
);
}
});