Skip to content

Commit 21fe12f

Browse files
committed
Copy coordinates instead of storing leaflet objects
1 parent 2ff0ba2 commit 21fe12f

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

  • web/client/components/map/leaflet

web/client/components/map/leaflet/Map.jsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,14 @@ let LeafletMap = React.createClass({
9999
this.map.on('singleclick', (event) => {
100100
if (this.props.onClick) {
101101
this.props.onClick({
102-
pixel: event.containerPoint,
103-
latlng: event.latlng
102+
pixel: {
103+
x: event.containerPoint.x,
104+
y: event.containerPoint.y
105+
},
106+
latlng: {
107+
lat: event.latlng.lat,
108+
lng: event.latlng.lng
109+
}
104110
});
105111
}
106112
});
@@ -269,7 +275,10 @@ let LeafletMap = React.createClass({
269275
x: pos.lng,
270276
y: pos.lat,
271277
crs: "EPSG:4326",
272-
pixel: event.containerPoint
278+
pixel: {
279+
x: event.containerPoint.x,
280+
y: event.containerPoint.x
281+
}
273282
});
274283
},
275284
registerHooks() {

0 commit comments

Comments
 (0)