Comments (6)
@mcalmus Can you give me a more detailed reproduction case here? pointToLayer
is called when so that users can transform the x,y coordinates from the service it something that inherits from L.Layer
(L.Marker
, L.CircleMarker
, ect...). As far as I know feature services don't support multiline strings as a geometry type and if they did we could convert it to a L.Polyline
and skip pointToLayer
.
I'm guessing your doing something like trying to convert a bunch of points to a multiline string on the fly which isn't really what this was intended to do but I can try to help if you provide a more detailed use case.
from esri-leaflet.
We are using pointToLayer
to set a custom icon
const options = {
url: <someUrl>,
pointToLayer: (feature, latlng) => new L.Marker(latlng, { icon: myCustomIcon })
};
const layer = esri.featureLayer(options);
There are several sets of layers available for the user to select from what is effectively a third-party service. Some of these layers have roads that include MultiLineString
items. Because I know which of these layers are exclusively roads, I can selectively not include the pointToLayer
definition for those layers, but it's nicer to just always include it in the configuration.
When it's included for one of these items, _redraw
hits on
from esri-leaflet.
@mcalmus I'm having a hard time finding a public layer service that has those types of items - do you have the URL to a public service that we can use to create a replication case to see the issue? Thanks!
from esri-leaflet.
Because I know which of these layers are exclusively roads, I can selectively not include the pointToLayer definition for those layers, but it's nicer to just always include it in the configuration.
@mcalmus so you want to be able to do this:
const layerOptions = {
pointToLayer: (feature, latlng) => new L.Marker(latlng, { icon: myCustomIcon })
style: { /*line and polygon style */}
}
const pointLayer = esri.featureLayer({
url: urlToPointLayer,
...layerOptions
});
const roadLayer = esri.featureLayer({
url: urlToLineLayer,
...layerOptions
});
And have it work? So we ignore pointToLayer
for non-point layers?
from esri-leaflet.
Yes. That's the idea.
And have it work? So we ignore
pointToLayer
for non-point layers?
I'm not suggesting it should "ignore" pointToLayer
so much as it shouldn't be using its presence as the way to identify the type of layer.
from esri-leaflet.
@mcalmus I'm having a hard time finding a public layer service that has those types of items - do you have the URL to a public service that we can use to create a replication case to see the issue? Thanks!
@gavinr I don't have a public layer. I'll see if I can get the data I'm using posted.
from esri-leaflet.
Related Issues (20)
- Support for Leaflet 1.9.0 HOT 11
- Leaflet 1.9.3 error - can't access property "properties", layer.feature is undefined HOT 10
- Popups broken with esri-leaflet 3.0.10 and leaflet 1.7.1 HOT 1
- DarkGray and Gray tilemap do not have dynamic attributions HOT 3
- Points on the map are not being shown when zoomed in HOT 6
- Documentation for tiledmapLayer is not strictly accurate. Can use alternatives to epsg:3857 HOT 9
- Esri attribution removes custom Leaflet prefix
- Dynamic Map Layer layerDefs force POST HOT 4
- Token is exposed in GET request HOT 5
- Husky update HOT 1
- From ArcGIS Enterprise: Zooming in at maximum extent the layer stops loading HOT 1
- FeatureLayer: initial tiles are requested concurrently with metadata HOT 2
- 🎃 𝗛𝗮𝗰𝗸𝘁𝗼𝗯𝗲𝗿𝗳𝗲𝘀𝘁 𝗗𝗲𝘁𝗮𝗶𝗹𝘀 𝗳𝗼𝗿 𝗣𝗮𝗿𝘁𝗶𝗰𝗶𝗽𝗮𝗻𝘁𝘀 👨💻 HOT 1
- Request GeoJSON by deault for feature services
- When the lod value for some zoom level is 0 tiles is not display properly HOT 3
- MapServer with custom LODs. initial tile set zoom level is wrong
- Error when using ESM CDNs - `The requested module does not provide an export named 'toLatLngBounds'` HOT 1
- Examples in Documentation return 401 error HOT 4
- esri-leaflet api required and freely allowed (terms of use)? HOT 7
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 esri-leaflet.