Comments (5)
Before digging into details: is there any reason why you're using Overlay
s for your icons? These could just as well be point features in a vector layer.
from openlayers.
Before digging into details: is there any reason why you're using
Overlay
s for your icons? These could just as well be point features in a vector layer.
In my project, there are many features, and there are complex filtering and judging requirements for the interaction of many states and data. There will be thousands of features, especially many line segments, each with different properties and statuss,and there will be requests and communication involved as well. If I put the icons into the feature system, Every time I write logic, I have to consider excluding these icons, making it difficult to avoid the integration of icon logic with features as a whole,On the other hand, the separate overlay system only has a few of nodes, Static information does not involve communication, so I can manage these overlays separately, which is relatively easy. Even if there are changes, I don't need to adjust them in the logic of the feature system.
from openlayers.
Before digging into details: is there any reason why you're using
Overlay
s for your icons? These could just as well be point features in a vector layer.
this is my personal opinion, but indeed using features can facilitate interaction. I just didn't consider that in cases with very limited interaction, such issues may arise. It can be considered a minor issue. For example, an icon only has one interaction, which is to click and display static information, so I didn't think much and just used it.
Besides ,I agree with what you said.
from openlayers.
If I put the icons into the feature system, Every time I write logic, I have to consider excluding these icons
Not if you put your icons on a separate layer and use Layer.getFeatures(pixel)
or Map.getFeaturesAtPixel()
with a layer filter. Then you have a clear separation. Also, there is https://www.npmjs.com/package/ol-marker-feature, if you want to combine the convenience of an Overlay with the convenience of a Feature.
from openlayers.
If I put the icons into the feature system, Every time I write logic, I have to consider excluding these icons
Not if you put your icons on a separate layer and use
Layer.getFeatures(pixel)
orMap.getFeaturesAtPixel()
with a layer filter. Then you have a clear separation. Also, there is https://www.npmjs.com/package/ol-marker-feature, if you want to combine the convenience of an Overlay with the convenience of a Feature.
OK, I understand. Actually, I had considered placing them on different layers before, but at the beginning of the project, I didn't think that a few icons would have a significant impact, so I didn't do that, and I didn't consider the limitations of overlays. Thank you for your response.
from openlayers.
Related Issues (20)
- ERROR Failed to compile with 1 error HOT 1
- Is there a way to know the style is declutter? HOT 4
- [BUG] Zoom level difference with MVT Layer HOT 5
- Modifying features in an OpenLayers VectorLayer very slow after use HOT 8
- The timezones.kml file is not updated to reflect the current timezone for Kazakhstan - UTC+05:00 HOT 1
- 如何只监听图层变化? HOT 3
- New IGC file format (2011) is not well understood HOT 1
- MapTiler satellite tiles in examples HOT 2
- setColor public method for Icon styles HOT 2
- Scrolling Issue with Input Field Over Map in Div Element
- WebGL Vector Layer wrapX support HOT 2
- Show rendered status from a layer in a specific instant HOT 2
- GeoTIFFSource: Specifying a custom client HOT 2
- Implementing Dynamic Range Adjustment using WebGLTileLayer? Need advice and feedback
- Vector layer canvas has a wrong size when the map is rotated HOT 1
- Problem with setFill() for styling VectorTile HOT 9
- Update terrain-rbg in interpolation examples
- IGC: new file format HOT 5
- Cannot apply multiple styles to WebGLPointsLayer
- Features rendered with WebGLVectorLayerRenderer disappear when WebGLTile layer is added to the map
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 openlayers.