Skip to main content
added 189 characters in body
Source Link
DanM
  • 257
  • 2
  • 14

I've got a leaflet map, to which I added a GeoJSON object (a polygon, specifically) and a number of Markers. The markers should all be inside the polygon, but they're not being displayed that way:

Marker and Polygon strangeness

In the example below, the GeoJSON is:

{"type":"Polygon","coordinates":[[[29.53125,49.921875],[29.53125,50.625],[30.9375,50.625],[30.9375,49.921875],[29.53125,49.921875]]]}

And the green-highlighted marker's coordinates are: [30.9332103729, 50.3615112305]

As you can see that marker is showing up well outside the outline of the polygon. The problem is considerably worse at wider zoom levels -- zoomed all the way in, the green marker makes its way just barely inside the polygon outline.

Any idea what could be causing this?

UPDATE: Turns out the issue appears to be the Markers, not the GeoJSON... when I zoom in on the map, the markers move. In this example, they all move to the northwest as I zoom in.

I've got a leaflet map, to which I added a GeoJSON object (a polygon, specifically) and a number of Markers. The markers should all be inside the polygon, but they're not being displayed that way:

Marker and Polygon strangeness

In the example below, the GeoJSON is:

{"type":"Polygon","coordinates":[[[29.53125,49.921875],[29.53125,50.625],[30.9375,50.625],[30.9375,49.921875],[29.53125,49.921875]]]}

And the green-highlighted marker's coordinates are: [30.9332103729, 50.3615112305]

As you can see that marker is showing up well outside the outline of the polygon. The problem is considerably worse at wider zoom levels -- zoomed all the way in, the green marker makes its way just barely inside the polygon outline.

Any idea what could be causing this?

I've got a leaflet map, to which I added a GeoJSON object (a polygon, specifically) and a number of Markers. The markers should all be inside the polygon, but they're not being displayed that way:

Marker and Polygon strangeness

In the example below, the GeoJSON is:

{"type":"Polygon","coordinates":[[[29.53125,49.921875],[29.53125,50.625],[30.9375,50.625],[30.9375,49.921875],[29.53125,49.921875]]]}

And the green-highlighted marker's coordinates are: [30.9332103729, 50.3615112305]

As you can see that marker is showing up well outside the outline of the polygon. The problem is considerably worse at wider zoom levels -- zoomed all the way in, the green marker makes its way just barely inside the polygon outline.

Any idea what could be causing this?

UPDATE: Turns out the issue appears to be the Markers, not the GeoJSON... when I zoom in on the map, the markers move. In this example, they all move to the northwest as I zoom in.

added geojson example
Source Link
DanM
  • 257
  • 2
  • 14

I've got a leaflet map, to which I added a GeoJSON object (a polygon, specifically) and a number of Markers. The markers should all be inside the polygon, but they're not being displayed that way:

Marker and Polygon strangeness

To be exact about itIn the example below, the GeoJSON Polygon's coordinates areis:

[[29{"type":"Polygon","coordinates":[[[29.53125,49.921875],[29.53125,50.625],[30.9375,50.625],[30.9375,49.921875],[29.53125,49.921875]]921875]]]}

And the green-highlighted marker's coordinates are: [30.9332103729, 50.3615112305]

As you can see that marker is showing up well outside the outline of the polygon. The problem is considerably worse at wider zoom levels -- zoomed all the way in, the green marker makes its way just barely inside the polygon outline.

Any idea what could be causing this?

I've got a leaflet map, to which I added a GeoJSON object (a polygon, specifically) and a number of Markers. The markers should all be inside the polygon, but they're not being displayed that way:

Marker and Polygon strangeness

To be exact about it, the GeoJSON Polygon's coordinates are:

[[29.53125,49.921875],[29.53125,50.625],[30.9375,50.625],[30.9375,49.921875],[29.53125,49.921875]]

And the green-highlighted marker's coordinates are: [30.9332103729, 50.3615112305]

As you can see that marker is showing up well outside the outline of the polygon. The problem is considerably worse at wider zoom levels -- zoomed all the way in, the green marker makes its way just barely inside the polygon outline.

Any idea what could be causing this?

I've got a leaflet map, to which I added a GeoJSON object (a polygon, specifically) and a number of Markers. The markers should all be inside the polygon, but they're not being displayed that way:

Marker and Polygon strangeness

In the example below, the GeoJSON is:

{"type":"Polygon","coordinates":[[[29.53125,49.921875],[29.53125,50.625],[30.9375,50.625],[30.9375,49.921875],[29.53125,49.921875]]]}

And the green-highlighted marker's coordinates are: [30.9332103729, 50.3615112305]

As you can see that marker is showing up well outside the outline of the polygon. The problem is considerably worse at wider zoom levels -- zoomed all the way in, the green marker makes its way just barely inside the polygon outline.

Any idea what could be causing this?

Source Link
DanM
  • 257
  • 2
  • 14

Leaflet issue: Marker and polygon not agreeing on locations?

I've got a leaflet map, to which I added a GeoJSON object (a polygon, specifically) and a number of Markers. The markers should all be inside the polygon, but they're not being displayed that way:

Marker and Polygon strangeness

To be exact about it, the GeoJSON Polygon's coordinates are:

[[29.53125,49.921875],[29.53125,50.625],[30.9375,50.625],[30.9375,49.921875],[29.53125,49.921875]]

And the green-highlighted marker's coordinates are: [30.9332103729, 50.3615112305]

As you can see that marker is showing up well outside the outline of the polygon. The problem is considerably worse at wider zoom levels -- zoomed all the way in, the green marker makes its way just barely inside the polygon outline.

Any idea what could be causing this?