I'm trying to represent sea current speed and direction on a leaflet map, I found a plugin that represents it in an animated way like this example:
https://onaci.github.io/leaflet-velocity/
but what I want to achieve is something else, I want to represent it using arrows just like they did here:
https://thredds.socib.es/lw4nc2/?m=radar
or this
https://apps.socib.es/Leaflet.TimeDimension/examples/example3.html
so if anyone can give me a hint on how to achieve it, it will be very nice.
My personal effort result in the use of leaflet-arrowheads plugin to achieve it but I will need a lot of customization.
Related
I'm using this Mapbox example for creating a measuring tool.
https://docs.mapbox.com/mapbox-gl-js/example/measure/
However, I want to have a small icon button that toggles the tool on and off. I don't always need to measure distances. Much like the polygon draw example here:
https://docs.mapbox.com/mapbox-gl-js/example/mapbox-gl-draw/
I can't quite figure out how to do it. Any direction would be great here. I'm still learning.
SOLVED: I took a better look at the mapbox draw documentation and saw that it supports length as well. This meant I was simply able to switch out the area.
i have design like below.
i need to put number widget in the path above and change the color of number based on some logic
provided with path asset like this (it's too long to be shown here)
while thinking how to achieve this, it's impossible to draw path from scratch because it's too complex (is it?),, i think if there's a way to detect list of coordinates of color from path provided above would be helpful, or maybe any other suggestion to achieve this? thank you..
===== edit
the requirement is so similar with map in game development like this
i wonder how they could accurately put the number widget in such position. hardcoding x and y coordinate wouldn't work in terms of responsiveness i think
This example shows a path snapped to the terrain. Is there a way to set the elevation along a path?
Ayvri is a good example of generally what I'd like this to look like, but customizable with mapbox.
You can probably convert your line into a polygon, then use a fill-extrusion layer to show something like this. It may not look good. I have a vague memory that Mapbox had a demo of something like this way back in the day when they had a surface API which gave the elevation at a point (prior to their current method)>
I have several GeoJSON features on the map and wonder if leaflet could notify me when I am over a feature. I think that's geofencing?
Yes, and there is nothing very complicated to implement it.
What do you mean by "I am over a feature"?
If you mean your mouse pointer or a kind of marker / point that represents your current position, you would simply need a plugin like leaflet-pip to determine which features contain your position, if any (react on map"mousemove" event for the mouse).
If you mean the current map view intersects some of the features, that would be slightly more complex, but still easily solved through another library like turf. Look for turf.intersect method. You would need to iterate over all your features, checked against a rectangle built from the current map view (probably something like: L.rectangle(map.getBounds()).toGeoJSON()).
Really hope someone can help me as I'm a bit stuck :S
I have a custom map of an event using the CATiledLayer so users can zoom in and scroll around the map. What I would like to do now is add the functionality to let the user know where they currently are on the map. I know it can be done as I've seen an app do this before. I'm not sure how to go about doing it though, maybe I need to convert lat/lon into pixels but I'm not sure if thats possible (depending on how big the image is, etc).
On another site it was mentioned to find out the boundaries of the map and then I can add pins to the map, but I'm not sure how to go about doing this? Will I need to find every coordinate (lat/lon) within the boundary so I can add the pin of where the user is currently?
If anyone can give me with any advice or pointers, I'd much appreciate it
You can use the route-me library by adding your own map source class. A good article that explains how to do it is here http://mobilegeo.wordpress.com/2010/07/07/route-me-native-iphone-mapping-framework/
I'm facing a challenge right now in trying to map GPS coords to a map that's an artist's rendition. In particular this is for a ski mountain, so the artist's rendition is a "trail map". The trail map is not accurate in that the whole mountain has been squeezed onto the one view, yet the actual topology of the mountain doesn't conform to the drawing.
I've tried several approaches:
1) Triangulation using known GPS coordinates of the lift stations. This is fairly simple to implement, yet this is not accurate enough and the algorithm fails if the rendition differs enough from the GPS map.
2) Creating a uniform grid for both the GPS map and the Trailmap, then doing a mapping from cells in the GPS map to the Trailmap. The downside to this is it can be a lot of busy work with no easy UI for doing it.
3) Calculating the vectors of each lift (being a straight line), find the closet lift station to a given GPS point, and calculate the estimated Trailmap location using this vector.
I'm considering #2, which is essentially the simplest solution. But if you've found a better way, I'd love to hear it.