Skip to content

Commit

Permalink
Merge pull request #28 from RyanBirtch-aot/bug-max-markers
Browse files Browse the repository at this point in the history
Added fix for popup bug
  • Loading branch information
abhilash-aot authored Oct 23, 2024
2 parents e11aed0 + abf0026 commit a2176e6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions components/src/components/Map/services/MapService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,13 @@ class MapService {
map.on('draw:created', (e) => {
const layer = e.layer;
if (drawnItems.getLayers().length === options.numPoints) {
map.closePopup();
L.popup()
.setLatLng(layer.getLatLng())
.setContent('<p>Only one marker for submission</p>')
.openOn(map);
.setLatLng(map.getCenter())
.setContent(
`<p>Only ${options.numPoints} features per submission</p>`
)
.addTo(map);
} else {
drawnItems.addLayer(layer);
}
Expand Down

0 comments on commit a2176e6

Please sign in to comment.