[OpenLayers-Users] How To: Positionate WGS84 tracks intoGauss-Boaga Map

Arnd Wippermann arnd.wippermann at web.de
Fri Nov 2 14:59:48 PDT 2012


if you want reproject feature coordinates from EPSG:4326 (WGS84) to other
projection than EPSG:900913 (SphericalMercator),
 
then you have to add the proj4js javascript library to your application.
 
By the way: How did you manage to show a tif in your browser?
 
Arnd
 
 

  _____  

Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von Riggi
Valerio
Gesendet: Freitag, 2. November 2012 21:56
An: openlayers-users at lists.osgeo.org
Betreff: [OpenLayers-Users] How To: Positionate WGS84 tracks intoGauss-Boaga
Map


Hi, I'm tring to track some gps data into a Gauss-Boaga map, but I don't
manage to put the track on the right place, how can I do?

This is the Track layer:
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;
                    }
                }
            })

And this is the Gauss-Boaga Projection:
    var options = {
    isBaseLayer: true,
    maxResolution: '0.84686783985005',
    strategies: [new OpenLayers.Strategy.Fixed()],
    displayInLayerSwitcher: true,
    size: new OpenLayers.Size(8745, 6696),
    numZoomLevels: 20
    };

    var gauss = new OpenLayers.Layer.Image(
                'Gauss-Boaga',
                'CTR588140.tif',
                new OpenLayers.Bounds(2556348.9846319141797721,
4227924.4383069388568401,
2563754.8438914027065039,4233595.0653625745326281),       <?php
//left,bottom,right,top ?>
                new OpenLayers.Size(8745, 6696),
                options
            );

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20121102/5c04dd64/attachment.html>


More information about the Users mailing list