map with arbitrary coordinate system

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

map with arbitrary coordinate system

lenoil
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Hi,

I would like draw features on my map with a arbitrary system coordinate.
Is it possible ?

Wha't the solution ?

This code doesn't work

 map = new OpenLayers.Map("map");
     
        var featurecollection = {
          "type": "FeatureCollection",
          "features": [
                { "geometry": {
                  "type": "GeometryCollection",
                  "geometries": [
                        {
                          "type": "LineString",
                          "coordinates":
                                [[11.0878902207, 45.1602390564],
                                [15.01953125, 48.1298828125]]
                        },
                        {
                          "type": "Polygon",
                          "coordinates":
                                [[[11.0878902207, 45.1602390564],
                                  [14.931640625, 40.9228515625],
                                  [0.8251953125, 41.0986328125],
                                  [7.63671875, 48.96484375],
                                  [11.0878902207, 45.1602390564]]]
                        },
                        {
                          "type": "Point",
                          "coordinates": [15.87646484375, 44.1748046875]
                        }
                    ]
                },
                  "type": "Feature",
                  "properties": {}
                }
              ]
        };
        var geojson_format = new OpenLayers.Format.GeoJSON();
        var vector_layer = new OpenLayers.Layer.Vector();
        map.addLayer(vector_layer);
        vector_layer.addFeatures(geojson_format.read(featurecollection));

Thanks for your help
Reply | Threaded
Open this post in threaded view
|

Re: map with arbitrary coordinate system

lenoil
This post has NOT been accepted by the mailing list yet.
the best that i found is the next (I use a metric system)

 map = new OpenLayers.Map('map', { projection: 'EPSG: 9001', maxExtent: new OpenLayers.Bounds(0, 0, roadMeters, heightMapMeters)
        });

and for the vector

 var vector_layer = new OpenLayers.Layer.Vector("json", {isBaseLayer : true});
        map.addLayer(vector_layer);

Do you have a another idea ?