[OpenLayers-Users] Using OpenLayers with Google,
Vector and Geoscopio layers
Willy
gruppi at willygroup.org
Thu May 20 03:26:32 EDT 2010
Hi everyone,
I would use OpenLayers with Google maps, Vector layers and Geoscopio layers.
I think I've some trouble with projections.
Geoscopio maps are available with projections EPSG:4326 and EPSG:3003.
How can I set all parts to work together?
If I use "standard" projection for google
I'm using that code get from various examples, in that way the only layer
doesn't work properly is the "Tuscany Map":
...
var options = {
projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG:4326"),
units: "m",
maxResolution: 156543.0339,
maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34,
20037508.34, 20037508.34)
};
map = new OpenLayers.Map('map',options);
map.addControl(new OpenLayers.Control.LayerSwitcher());
var gphy = new OpenLayers.Layer.Google(
"Google Physical",
{type: G_PHYSICAL_MAP, sphericalMercator:true}
);
var wms = new OpenLayers.Layer.WMS("Tuscany Map",
"
http://web.rete.toscana.it/sgrwms/com.rt.wms.RTmap?servicename=_rt_wms&version=1.1.1&SRS=EPSG:3003
",
{
projection: map.displayProjection,
layers: 'idcomuni',
transparent: 'true'
});
var layerGML = new OpenLayers.Layer.Vector("Layer Vector", {
projection: map.displayProjection,
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.HTTP({
url: "markers.kml",
format: new OpenLayers.Format.KML({
extractStyles: true,
extractAttributes: true
})
})
});
map.addLayers([gmap, ghyb, layerGML]);
...
--
Willy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100520/9132c46f/attachment.html
More information about the Users
mailing list