[OpenLayers-Users] tilecache + goole maps layer
vmon
valemunoz at gmail.com
Wed Mar 28 16:01:51 EDT 2012
HI
i am working with tiles with projection 4326 and google maps. When i change
layer from tiles 4326 TO google maps (900913/3857)the center display in
other continent :/.
is posible work with both?.... maybe reproject some one?
code:
var x_left = -91.04770;
var y_bottom = -58.0000;
var x_right = -43.23819;
var y_top = -16.95350;
var v_maxResolution=0.07902398403828125;
var v_numZoomLevels = 14;
var options = {
projection: new OpenLayers.Projection("EPSG:900913")
,displayProjection: new OpenLayers.Projection("EPSG:4326")
,units: "m"
,maxResolution: 156543.0339
,maxExtent:new
OpenLayers.Bounds(x_left,y_bottom,x_right,y_top).transform( new
OpenLayers.Projection("EPSG:4326"), new
OpenLayers.Projection("EPSG:900913"))
};
map = new OpenLayers.Map('map', options);
var layer = new OpenLayers.Layer.TileCache("VMap0",
["http://localhost/tiles/3_0",
"http://localhost/tiles/3_0",
"http://localhost/tiles/3_0",
"http://localhost/tiles/3_0"],{layers: 'base'},{transitionEffect:
'resize','buffer':0} );
var gsat = new OpenLayers.Layer.Google(
"Google Satellite",
{'sphericalMercator':true});
map.addLayers([layer, gsat]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new
OpenLayers.LonLat(-70.611749506556,-33.440076830188).transform(
new OpenLayers.Projection("EPSG:4326"),
map.getProjectionObject()
), 9);
RG
VM
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/tilecache-goole-maps-layer-tp4665608p4665608.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list