[OpenLayers-Users] Re: google and map with projection 4352
vmon
valemunoz at gmail.com
Tue Mar 27 12:10:17 EDT 2012
thank dave! ... does not work :/:
my code:
map = new OpenLayers.Map("map", {
projection: new OpenLayers.Projection("EPSG:900913"),
units: "m",
maxResolution: v_maxResolution,
maxExtent: new OpenLayers.Bounds(x_left,y_bottom,x_right,y_top),
//restrictedExtent: new OpenLayers.Bounds(-17557692.747438,
-116865.2041299, -3860177.281188,9275716.8298701),
displayProjection: new OpenLayers.Projection("EPSG:4326"),
controls: [
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.KeyboardDefaults(),
new OpenLayers.Control.PanZoom(),
new OpenLayers.Control.ZoomBox(),
new OpenLayers.Control.Scale(),
new OpenLayers.Control.Attribution()
]
});
layer = new OpenLayers.Layer.MapServer( "proj 4326",
"http://localhost/cgi-bin/mapserv.exe?",
{map:'c:/ms4w/Apache/htdocs/tilecache/full.map',
mode:'map',Image:'image/png',transparent:true, reaspect: "true"},
{isBaseLayer: true, visibility: true,
projection: new OpenLayers.Projection("EPSG:3857")});
var gsat = new OpenLayers.Layer.Google(
"Google Satellite",
{type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22});
map.addLayers([layer,gsat]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new
OpenLayers.LonLat(-70.6001051643356,-33.4137024636867).transform(
new OpenLayers.Projection("EPSG:4326"),
map.getProjectionObject()
), 5);
mapfile code:
MAP
NAME "map_test"
SIZE 512 512
#EXTENT -76.0199836653 -56.2163458289 -66.8402961623 -17.4712286414
EXTENT -112.888238 -57.06133625 -7.419488000000001 13.25116375
UNITS dd
FONTSET "fonts/fonts.txt"
PROJECTION
'proj=longlat'
'ellps=WGS84'
'datum=WGS84'
'no_defs'
''
END
# Background color for the map canvas -- change as desired
IMAGECOLOR 122 206 232
OUTPUTFORMAT
NAME png
DRIVER "AGG/PNG"
MIMETYPE 'image/png'
IMAGEMODE RGB #RGBA transparente
EXTENSION "png"
FORMATOPTION "TRANSPARENT=ON"
FORMATOPTION "INTERLACE=ON"
FORMATOPTION "QUANTIZE_COLORS=256"
END
....
RG
VM
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/google-and-map-with-projection-4352-tp4657348p4661408.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list