Hi,
Never say die! It isn't too hard, but you have something to read and understand. I thought my example is easy. Please check http://docs.openlayers.org/library/index.html http://docs.openlayers.org/library/spherical_mercator.html and have a look at http://openlayers.org/dev/examples/ http://openlayers.org/dev/examples/mouse-position.html Hareck ----- Original Message ----- From: Mihai Visan To: OpenLayers User list Sent: Thursday, December 09, 2010 1:41 PM Subject: Re: [OpenLayers-Users] display custom lon and lat on map I played a little with your example Harald, But I can't make it work for me. Probably JavaScript is to hard for me :-(( Is there a simpler solution? ----- Original Message ----- From: Harald Eckert To: Mihai Visan Sent: Thursday, December 09, 2010 1:32 PM Subject: Re: [OpenLayers-Users] display custom lon and lat on map Hi, please have a look at this example: http://www.hareck.lima-city.de/OL/testol-wms-if-vector.html There are two different Mouse.Position installed. Hareck ----- Original Message ----- From: Mihai Visan To: Hareck Sent: Thursday, December 09, 2010 12:10 PM Subject: Re: [OpenLayers-Users] display custom lon and lat on map Thanks Harek, It works except that I can't set my custom min and max coords. This is what I tried: var minLon = 57360; /* left margin */ var maxLon = 90064; /* right margin */ var minLat = 65575; /* bottom margin */ var maxLat = 98279; /* top margin */ map = new OpenLayers.Map("map", { //maxExtent: new OpenLayers.Bounds(-maxLon, -maxLat, maxLon, maxLat), //projection: new OpenLayers.Projection("EPSG:41001"), //displayProjection: new OpenLayers.Projection("EPSG:900913"), controls: [ new OpenLayers.Control.Navigation(), new OpenLayers.Control.PanZoomBar(), new OpenLayers.Control.LayerSwitcher(), /* Open the switch layers panel */ new OpenLayers.Control.MousePosition({ displayProjection: new OpenLayers.Projection('EPSG:900913'), new OpenLayers.Bounds(minLon, minLat, maxLon, maxLat), emptyString:'?,?'}) ], maxResolution: 'auto', units: 'meters', numZoomLevels: 6, }); ----- Original Message ----- From: Hareck To: Mihai Visan Cc: [email protected] Sent: Thursday, December 09, 2010 10:50 AM Subject: Re: [OpenLayers-Users] display custom lon and lat on map Hi, please have a look at http://dev.openlayers.org/releases/OpenLayers-2.10/doc/apidocs/files/OpenLayers/Control/MousePosition-js.html. You can use new OpenLayers.Control.MousePosition({emptyString:'?,?'}) without displayProjection, then displayProjection of map is used. However you can also set the own displayProjection for Mouse.Position new OpenLayers.Control.MousePosition({displayProjection: new OpenLayers.Projection('EPSG:yxz'), emptyString:'?,?'}) Harek ----- Original Message ----- From: Mihai Visan To: OpenLayers User list Sent: Thursday, December 09, 2010 9:06 AM Subject: [OpenLayers-Users] display custom lon and lat on map Hi everybody I come back with a question that I didn't received an aswer. The situation is like this: I have a map with a Image as basic layer and I want to display mouse position as custom lan and lat. I have custom min and max lon and lat and I know image size. It probably have something to do with "new OpenLayers.Control.MousePosition()" control, but I can't figure it out. Right now I receive only pixel position reported at image bounds (ex: 231.0000, 456.0000) and I want something like this: 67548, 75324 lat lon thanks for help ---------------------------------------------------------------------- _______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users ------------------------------------------------------------------------------ _______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
_______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
