Bing Maps v7 - Display TileLayer above Polygon - bing-maps

I am writing an application that needs to show a variable number of TileLayers and Polygons on a Bing Maps control in an order specified by another application.
Whilst I can get all items to display correctly, the zIndex I set doesn't do as I expect - the polygons appear in the correct order in relation to each other as do the tile layers, but all the tile layers are always below the polygons, e.g.
Expected display order set using zIndex:
TileLayer 1
Polygon 1
TileLayer 2
Polygon 2
Renders as:
Polygon 1
Polygon 2
TileLayer 1
TileLayer 2
Is this layout possible using Bing maps?

Polygon layers are vectors, whereas tile layers are rasters. I believe that Bing Maps (and, for that matter, every other web-mapping API that I'm aware of - Google Maps, Leaflet etc.) will always render vector layers on top of raster layers.

Related

Mapbox : Loading/Rendering 3D buildings at a large scale

I'm trying to display a 3D skyline/panoromic view of Manhattan using Mapbox yet with Mapbox GL extruded 3D buildings start to disappear below zoom level of 15. Is there a way to render/display them at zoom level around 11-12? Or an alternative way by clipping/filtering rendered/loaded data by mapbox?
I have tried to filter the map to the area of Manhattan and Roosevelt islands yet later found out it's not possible to clip/filter MapBox to a geographical area.
As the final result I'm hoping to render the buildings at the final view shown in the last image.

GeoServer Vector Tiles show tile boundary issue in Mapbox GL JS

I use GeoServer to provide Vector Tiles (based on the GeoServer Vector Tile Extension) of my biking trails as .pbf.
The data are added as vector source and visualized using Mapbox GL JS.
Additionally, I use the GeoServer perpendicularOffset to offset the lines (as I always have two directions of the biking trail).
A problem occurs when visualizing the data within Mapbox. The lines are cut at the tile edges, although they are visualized correctly using the layer preview on GeoServer.
The further I zoom in the map, the less the clipping of the lines happens and at a very detailed zoom, the lines are drawn correctly.
I already tried to use a large enough buffer and modify the tile size, as these were suggestions when researching the problem. Unfortunately, these settings had no effect.
I have another vector source layer for the base map, there I have no problems.
It seems to me, that offsetting the lines might be a problem.
Any idea what I can try?
the tile size of Geoserver's tile grid is 256x256 , but mapbox need 512x512, add a custom tile grid, set the tile size to 512x512, generate your vector tile with the custom tile grid should be ok.

Visualising road segments as heatmap in Leaflet efficiently

I have data consisting of parts of road segments of a city, with different number of visits. I want to plot the data on a Map and visualise it in the form of a heatmap.
I have two related questions:
I have the data from Open Street Maps (OSM) in the form of pairs of node ID's, where node ID correspond to the unique ID being assigned to a point by OSM. I also have a mapping for each node Id to its corresponding coordinates. Is there any Leaflet or Mapbox utility or plugin, which can plot a trip / highlight the road segment using 2 node ID's. I can always do it manually (by using the coordinate mapping and converting it into GeoJSON), but the problem occurs with the line width -- I have to make it exactly overlap with the width of the road, so that it seems that I am highlighting a road segment.
Is there any plugin / utility for Leaflet or Mapbox, which can be used for plotting polylines or geojson as heatmap efficiently? My current approach is calculating the color for each polyline and encoding that as a geojson property. But the problem is that with the increase in the number of lines (> 1K) the rendering becomes a pain and the method is not feasible. There are some plugins for Leaflet out there for plotting heatmap, but all of them are for points only and not lines. Any approach using WebGL would be really great.
An approach which I thought of could be converting my data into a shape file, upload to Mapbox Studio and use as a layer directly. But I have no idea how to go about doing that i.e. creating a shapes file, encoding the information in such a way that the complete road segment gets highlighted in the correct color.

Mapbox not able to change the style of vector tiles at run time

I am using tippecanoe command line utility to create my application vector tileset. This is creating a directory structure as per the z/x/y coordinates which is perfectly fine. I have a certain group of features(allocated with a layer) which do not need z to be up to 21 zoom level so it's creating the tiles up to zoom-level 14. It is critical in my case to not to waste the memory space by increasing the max-zoom to 21 for certain layer of features.
As per my understanding, mapbox gl-js queries for the vector tiles as per its coordinate space.
So during my zoom-in from 6 to 21, although zoom-level > 14 tile queries are responding with 404, gl-js is adopting the same tile which is available at 14.
The problem is,
For example, If I click on any feature, I need that feature to be highlighted. I am doing it by filtering out the layers as :
//hiding the current layer
mapBox.setFilter(currentLayer, ["==",'gid', "_none_"]);
//showing only the clicked feature by filtering it out with a unique id it has
mapBox.setFilter(highlightedLayer, ["==",'gid', feature_gid]);
This works as expected for zoom-level < 14 but if zoom-level exceeds 14 (the max-zoom while tile creation) then it is not able to render the tile with applied layer style as it tries to fetch a tile which is not there on my server. So my question is if a source tile at particular zoom level is giving 404 then why not apply the layer style to whichever tile is available at zoom level 14 ?
Any help to solve this problem?
This functionality is not supported by mapbox-gl. You need to go back to Tippecanoe and generate the tiles for this zoom level.
Note that you those new tiles can be similar in terms of data as the other zoom levels.
Remember that tiles are like images generated at a precise zoom level. If you zoom in, one tile will be divided in many tiles.

Leaflet finding distance to nearest markers on all 4 directions

I have a leaflet map with several thousand markers that are clustered. I show an icon for the users current location on the map and I need to show the distance to the nearest marker in all four directions. So for example, North:100M, South:1KM, East:.... and so on.
I dont see an inbuilt way in leaflet to do this. Any ideas on I can go about accomplishing this ?