AW: [OpenLayers-Users] points bouncing on their coordinates

Arnd Wippermann arnd.wippermann at web.de
Tue Dec 6 16:52:40 EST 2011


Hi,

Add projection to the map options. 

By default it is EPSG:4326 and somehow it is possible in one map to mix
EPSG:4326 and EPSG:900913.

map = new OpenLayers.Map('mapa',{
            projection:new OpenLayers.Projection("EPSG:900913"),
            controls: [
            new OpenLayers.Control.Navigation(),
            //new OpenLayers.Control.ScaleLine(),
			new OpenLayers.Control.KeyboardDefaults(),
			new OpenLayers.Control.PanZoom()],
});
 

Arnd

-----Ursprüngliche Nachricht-----
Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von vrbikdan
Gesendet: Dienstag, 6. Dezember 2011 22:22
An: users at openlayers.org
Betreff: [OpenLayers-Users] points bouncing on their coordinates

Hi all,
I'm trying to make map with some points so I defined this points in code
with their coordinates, but problem is, when I try to pan with the map. This
points doesn't stay in their locations and moving some around. I can't
figure it out, where is problem. Aplication is here: 
http://vrbikdan.xf.cz/blom/mapa.html# http://vrbikdan.xf.cz/blom/mapa.html#
and part of the code here:

var featurecollection = {
              "type": "FeatureCollection", 
              "features":[
              
{"type":"Feature","geometry":{"type":"Point","coordinates":[19.21,43.23]},"i
d":"1",
				"loc_name":"Desna",
				"x_coor":"16.1",
				"y_coor":"42.8",
				"z_coor":"300",
				"municip":"x",
				"watershed":"x",
				}]};
		       
           var geojson_format = new OpenLayers.Format.GeoJSON();
           var HydroelLayer = new OpenLayers.Layer.Vector(); 
           map.addLayer(HydroelLayer);
           HydroelLayer.addFeatures(geojson_format.read(featurecollection));

Thanks a lot
Dan

--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/points-bouncing-on-their-coordinates-
tp7068441p7068441.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list