openlayers: ol.control.MousePosition reports invalid lat/lon on wrapped maps.

When I implement a 'many world’s wrapX implementation with my vector layer and a tiled map layer, the mouseposition control reports invalid coordinates

Example is at https://jsfiddle.net/smtxcdeo/ - put your mouse over world +1 or -1 and the coordinates system reported is greater that 180/-180.

map.addControl(new ol.control.MousePosition({
className: "mapCoords",
projection: "EPSG:4326",
            coordinateFormat: function(coordinate) {
                return ol.coordinate.format(coordinate, '{y}\', {x}\'', 4);
            },
            target: 'coordinates',
            undefinedHTML: ""
}));

Is this by design? Is this a bug? How would I get it to report the correct lat/lon (mouseover of a feature on the other ‘worlds’ returns a co-ordinate within world 1 as expected - this causes other issues with popups etc.)

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 20 (8 by maintainers)

Commits related to this issue

Most upvoted comments

@fredj can we reopen this issue? I think it was prematurely closed by the Stale bot.