Adding drop-shadow to map layer - mapbox

I'm a UI Designer, and my client will use mapbox for his website. I'm working on a custom style where I want to make the whole map white with a drop-shadow.
I know only basics for now, so there's my question. How can I add a drop-shadow for 'land' layer? I just want to know if it's possible and it would be awesome to know the solution.
Thanks,
Robert

If you're talking about a style based on Mapbox Streets, then no, it's not possible, because there is actually no "land" layer. Instead, there are ocean layers, and land is just the background.
In general, "drop shadows" aren't really something you can easily do in Mapbox GL, although there are ways to kind of fake it with properties such as fill-translate.

Related

Mapbox GL - transition animations for unclustering and for active feature

In Mapbox GL JS, I'm looking to use clustering + use a different icon for one feature which is currently defined as "active". I want the necessary transitions (unclustering + change of the active feature) to be animated, but can't find a way of making this all happen.
Mapbox provides an example showing how to implement clusters, which uses different layers for the clusters and for non-clustered features. This technique can also be used for rendering the "active" feature in its own layer with a different image. When a cluster breaks ("unclusters") into features, it basically gets removed from the clusters layer, and the features get added to the "unclustered" features layer. But this doesn't allow adding a transition animation, since there isn't really a transition here. I would like to show the cluster splitting into features, with each feature moving to its respective location.
Any ideas how to solve this?
Some ideas that don't quite provide a full answer:
Use Leaflet with the markercluster plugin and its "spider" behavior for clustering. This works and provides a nice "spider" transition animation for unclustering. However there is no "official" binding between leaflet and Mapbox GL, so I'm reluctant to use that (there is just this which I would need to modify and it's based on undocumented Mapbox internals). Also I'm now sure whether this is good or bad performance-wise with thousands of features. And I know from experience that adding an animation to modify the shape of Leaflet markers (for active/inactive transitions) doesn't really work.
Use markers in Mapbox, instead of layers, but then how to do any sort of clustering?
I can't think of any reasonable way to implement this just using Mapbox GL JS, short of learning WebGL and implementing a custom source.
But I wouldn't write off the Leaflet+Mapbox approach - in my experience, the performance is ok (though I haven't tested with clusters or what you're trying to do).
There is a similar approach with OpenLayers: https://openlayers.org/en/latest/examples/mapbox-layer.html I have also used this and it worked fine.
Finally, it seems there are quite a few Leaflet and OpenLayers libraries that specifically solve the animated clustering issue: https://gis.stackexchange.com/questions/17250/how-to-create-animated-cluster-markers-in-openlayers-leaflet (And most of these answers are very old, so perhaps there are more libraries now).

Fluent Design Menus in Hololens

I'm currently designing a Hololens application and I'm pretty new to everything. The menu right now seems a little "old-school" for my taste. I'd like to create a user-friendly menu that could be pinned in place or move around as the user wishes.
I've been checking out fluent designs and found the DesignLab toolkit (https://unitylist.com/p/19/MR-Design-Labs-Unity) but its from 2017. Is there anything new I could use to make my menus?
You can use the ButtonHolographic from the HoloToolkit Example. These are flat designed uwp buttons. Take a look at the example scenes from the holotoolkit-example.
Check out the PressableButton.prefab in MRTK. This aligns pretty exactly with the system style and fluent design. There's documentation here:
https://microsoft.github.io/MixedRealityToolkit-Unity/Documentation/README_Button.html
It's relatively easy to use the same materials and shaders to create a background panel for text or other things that aren't buttons.
Keep an eye out for how the shader reacts when MRTK's simulated hand approaches it. There's a lot of cool reactive fluent elements there.

Leafleftjs - OpenstreetMap : Bring road names on top of Overlay layers

I am new to OpenstreetMap and Leafletjs. I am trying to implement a map displaying journey time information on motorways (also called highways in some part of the world) by using different colors to show road congestion and the problem I'm facing is, once the map tiles are rendered, it comes with all information, like town/city names, road names etc.
On the basis of road information that I receive, I create road colorings in an overlay that sits on top of the tile layer. The problem is, once that happens, the road colorings cover the road names that appear on the tile layer. The problem can be seen in the image displayed below.
Is there a way, I could extract the road names so that I could put it in a layer above the road coloring layer so that road names appear on top of road colorings.
Thanks for any sort of help, Looking forward to some replies.
Thanks
In theory, you could create two sets of tiles: one with the road lines, another with the shields (labels). Render the shields tiles with a transparent background. Then hack Leaflet around to have a second tile layer above the overlay layer.
However... that's a whole bunch of hassle for a fairly simple problem. So: why not render the road numbers alongside the roads, rather than on top of them? That way, your overlay line won't obscure the numbers. Here's an example of a style that does this (disclaimer: my site!).
Assuming you're using Mapnik to render your tiles, you'll want to use TextSymbolizer rather than ShieldSymbolizer. Customising the style is (of course) much easier if you're using TileMill rather than pure Mapnik XML.
As you say, the roadnames (here ref icon symbolizers) are part of the OSM raster map tiles and can't changed easily.
So the easiest solution would be to switch to a mapstyle without labels.
Another idea would be to add more alpha to your cusom GPS track, so it get's more 'hollow' and fits better in the mapstyle. But the default OSM style isn't good for adding informations on top, as this basemap is already to detailed. Maybe it makes sense to use another one:
http://wiki.openstreetmap.org/wiki/Featured_tiles

With the new maps in iOS6, is it possible to change colors of layers (parks, water, building)

I understand it's not ideal to change mapkit colors but specifically for a location based game I'm creating I'd like to have to colors much less dramatic and more dark. Is there a built in way that I can accomplish this? Since the game won't be specific to a certain region custom overlays wouldn't really work. I know with the old google maps the only way to do so was to create a javascript version of the map and add it in a webview (not ideal for the game) but with this new apple maps is there a way to redraw the shapes of these elements (parks, water, building) with a different color.
I don't have a complete understanding how the previous or current mapkits work from the ground up so if I'm missing any information or am confusing I apologize.
No there is no way you can do that in the current iOS6 maps.
The MapKit Reference does not have any inbuilt functions to do that.
I would seriously ask you to reconsider changing colors of the current MapKit even if you could do it through some other hack. You might get rejected from the App Store.
You have 2 options
a. Instead use your own maps from other vendors if you want to change colors and so for different places.
b. Overlays are a good way to go too but they are heavy work on REST side of downloading maps. I am currently using this in my map right now because all my map tiles are generated on the fly and I do not have to do too intensive work on the iPhone.

How to draw a piechart in iPhone

I want to draw a piechart in my application. Do anyone know any code or tutorial to help me out. I found some in the following link
http://rajeev.name/blog/2009/01/18/drawing-pie-charts-using-iphone-sdk/
but if there is any other more efficient way to do it, I want to learn it.
I'm not sure if you know how to do pie charts on other platforms, but there really are some basic techniques that you should be aware of and understand, before embarking on creating pie charts on ANY platform.
See here for a pretty good discussion. There are many more out there, if you want to learn more.
Applying that to the iPhone isn't going to be child's play, but it's not too hard either. If you are looking for a library to do the work for you, look around and you'd probably find something to give you a head start.
KeepEdge offers an iPhone charting/graphing API:
http://www.keepedge.com/products/iphone_charting/
You can also check the source code of AppMobile, which has a pie chart embedded inside it:
http://github.com/omz/AppSales-Mobile/tree/master
I will recommend you to look at the "Animating Pie Slices Using a Custom CALayer" page!.
there is new, nice Pie Chart 3D library. 3D charts which you can rotate and scale with fingers + protocol for getting information about tapped slice
http://iphone.orpi.pl/?p=20