Comments (9)
Changing:
if (layer instanceof L.Marker) {
To:
if (layer instanceof L.Marker || layer instanceof L.CircleMarker) {
Would actually make it for the CircleMarker case.
from leaflet-lasso.
I am also hoping to be able to do this with either Circle or CircleMarker, it seems to be an issue with the getSelectedLayers() function. Within there there is a check to see if the layer is a "Marker" and if so calls
var r = e.toGeoJSON().geometry;
which in turn calls getLatLng().
Simply changing the o.Marker to o.Circle will get it to try the circles, but it fails to convert the layer. I didn't see what was different in the data structure for the Marker vs the Circle that it shouldn't have worked, but it doesn't.
from leaflet-lasso.
The issue could be that GeoJSON doesn't have an official Circle geometry. There is a draft https://github.com/geojson/geojson-spec/wiki/Proposal---Circles-and-Ellipses-Geoms, never implemented yet.
In order to use turf's capabilities, we can convert Leaflet Circle to GeoJSON Polygon using @turf/circle.
from leaflet-lasso.
It would work only for the center point, the plan here is to support also intersecting with the outer circle
from leaflet-lasso.
That's right for Circle layers. But what about CircleMarker layers? Those have radius in pixels, which in my opinion would be equivalent to trying to match the Marker's image silohuette.
from leaflet-lasso.
Unfortunately, Marker image silouhette is also not matched currently. Only real geocoordinates
from leaflet-lasso.
@matonga is there an unminified version of the js that I can do your edit in, to make it select CircleMarker?
from leaflet-lasso.
@matonga no worries I got it to work with the minified js: towards the end of the file:
(function(e){if(e instanceof o.Marker )
becomes:
(function(e){if(e instanceof o.Marker || e instanceof o.CircleMarker )
from leaflet-lasso.
Implemented in 2.0.0
from leaflet-lasso.
Related Issues (20)
- Turn off the default control lasso button HOT 2
- Many thanks for your work! HOT 1
- Error with polygon selection HOT 10
- Touch support HOT 8
- Error with usage in Angular/Typescript HOT 8
- Problem with Angular and IE11 HOT 2
- lasso.finished performance for large geojson feature set HOT 8
- Use a spatial index for better performance HOT 2
- Workarounds to make it work with touch devices HOT 8
- performance for too many layers HOT 4
- Any chance you could make this work with Leaflet.SvgShapeMarkers? HOT 7
- working with cluster HOT 8
- Clicking lasso button lead towards browser address bar with # sign. HOT 3
- Workarounds to make leaflet-lasso work with touch devices (with Leaflet version 1.6.0 and above) HOT 5
- Can we change the selection mode to polygon selection HOT 1
- Marker clusters rendering change to simple markers when lasso is enabled
- Marker Cluster and Lasso HOT 3
- Strange error when using lasso code with leaflet-curve HOT 8
- Unable to select geojson object with leaflet lasso HOT 12
- how to use in react-native? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leaflet-lasso.