I'm using openlayers (v6.4.3) to display a map with features in different layers. I want to prevent overlay of feature's icons from different layers : if two of them overlap, I have to move one of the icons. I looked on the official openlayer's documentation but I can't find an option or a method to achieve that.
Thanks for any help !
Related
I have a map where i used the leafet-geojson-vt plugin (https://github.com/brandonxiang/leaflet-geojson-vt/tree/leaflet1.0.0) to draw GEOJSON data in a canvas layer with geojson-vt.
I'm able to add the layer to the map, however, I don't know how to add popups on click for each polygon/tile/feature in the layer. I've tried searching for examples but cannot find ones using the geojson-vt plugin.
How can I add such functionality using the example in the link above?
Any help is appreciated.
I create map using Mapox with 7 layers thanks to this example. This layers I can switch on and switch off on the map thanks to buttons for each layers.
At the same time I don't have any spetial knowledge in Javascript. It's restrict me to create legends (div element) for each layers. The particular legend(s) must show on the fly when particular layer(s) switched on.
I found function L.mapbox.legendControl. But how it applies for my purpose?
Where and which code have to use for make legend like pictured here
So, I have a map that shows RSS News Items by state.
When I am zoomed in, I see the icon of the source news outlet: Reuters, Yahoo, Fox, CNN.
What I need is a clustering layer that shows generic, clustering icons at high zoom levels but shows the source icons when zoomed in enough for the space between icons is clearly defined.
I have tried to augment existing clustering layers to accept the specific icons to no avail.
Has anyone done this before?
I can't imagine this has not been done in the past.
Any directions on where to find the answer would be appreciated.
So I have a probably not so unique scenario. The simplest way to explain it is a google map with all 50 US states, each state will have two markers. The markers are both driven by the same lat/long value. The problem Im having is that the markers are rendering ontop of one another. I somehow need to have them render next to one another or offset so that I can see both. The problem is how do I get it to not overlap into another state.
I saw some really neat "spider" functionality where it renders one marker and then if you click on it the others fan out, but the website was in another language.
I am going to try and use the following library.
https://github.com/jawj/OverlappingMarkerSpiderfier
The problem with the above implementation is that I am using a combination of KML and google maps client-side. I dont see a way to implement that for the kml markers
The Overlapping Marker Spiderfier project on GitHub will probably accomplish what you need.
Otherwise you can play around with the Marker's icon property. The icon can accept a Symbol which has and anchor that can be shifted from the default location (0,0).
Symbol documentation: https://developers.google.com/maps/documentation/javascript/reference#Symbol
Does the CloudMade API have the ability to control the z-order or z-index of the marker overlays (e.g.icons)?
I have used this before in Google Maps to make certain icons with more importance draw over the top of other icons with lesser importance (especially in some zoom levels where they may bunch together).
The Google Maps GMarker has the zIndexProcess option to handle this. Does anyone know if CloudMade has this facility? I have scoured the API docs and found nothing. Or does anyone here perhaps have an ad-hoc method that ensures one marker (or group of makers) will be drawn on a layer above the other?
Currently this feature is not available at CloudMade, but I'll add it to our Feature Requests list..