[OpenLayers-Users] Gauss-Boaga Projection
Riggi Valerio
vash.84 at virgilio.it
Wed Oct 31 03:04:10 PDT 2012
Hi, all I'm tring to _visualize some tracks on a Gauss-Boaga map from a
.tif image_, but I don't manage to set the .tif so to visualize
correctly the tracks on the map.
With the tif I have also a *.tfw file* which contain this resolutions
and coordinate:
0.84686783985005
0.00000000000000
0.00000000000000
-0.84686783985005
2556348.98463191420000
4233595.06536257450000
*My code**is:*
var mercator = new OpenLayers.Projection("EPSG:3004"); <!--
Gauss-Boaga -->
var geographic = new OpenLayers.Projection("EPSG:4326"); <!-- WGS84 -->
var gauss = new OpenLayers.Layer.Image(
'Gauss-Boaga',
'CTR588140.tif',
new OpenLayers.Bounds(2556348.98463191420000,
4227924.438,2563754.843,
4233595.06536257450000).transform(mercator,geographic),
new OpenLayers.Size(8745, 6696)
);
map = new OpenLayers.Map({
div: "map",
projection: mercator,
maxExtent: new OpenLayers.Bounds(2556348.98463191420000,
4227924.438,2563754.843,
4233595.06536257450000).transform(mercator,geographic),
maxResolution: 0.84686783985005,
layers: [gauss,new OpenLayers.Layer.PointTrack("Tracks", {
projection: geographic,
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.HTTP({
url: "track.kml",
format: new OpenLayers.Format.KML({
extractTracks: true,
extractStyles: true
})
}),
dataFrom: OpenLayers.Layer.PointTrack.TARGET_NODE,
styleFrom: OpenLayers.Layer.PointTrack.TARGET_NODE,
eventListeners: {
"beforefeaturesadded": function(e) {
// group the tracks by fid and create one track for
// every fid
var fid, points = [], feature;
for (var i=0, len=e.features.length; i<len; i++) {
feature = e.features[i];
if ((fid && feature.fid !== fid) || i ===
len-1) {
this.addNodes(points, {silent: true});
points = [];
} else {
points.push(feature);
}
fid = feature.fid;
}
return false;
}
}
})
],center: new OpenLayers.LonLat(15.4385912418365,
38.2424157857895).transform(geographic, mercator),
zoom: 15
});
map.addControl(new OpenLayers.Control.LayerSwitcher());
};
*What is wrong?*
Thank's to all
Valerio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20121031/c458907a/attachment.html>
More information about the Users
mailing list