jVectorMap - Drill-down map - custom background - javascript

I'm using drill-down map from jVectorMap and I'm trying to set custom background color to second layer of the map. To customize main level, I use "main" parameter, but I don't know how to expand this to lower levels of the map.
Thanks in advance,
Maciej

Related

Mapbox GL JS, change POIs size

I'd like to know if there is a way to change POIs size (schools, restaurants, ...)
.
I'm using Mapbox GL v2.8.2
On the documentation I only found about layers, but I'm not sure the "native" POIs are related to layers.
Thanks
The POIs come from the Streets style. You can create a custom style in Mapbox Studio to edit the size of the POIs.
Go to studio.mapbox.com
Click Styles > New style
Select Streets then click Customize Streets
Under components, select Point of interest labels and adjust the Icon scale
Click Publish
Locate your new style in the list then click the 3 dots
Copy the Style URL
Set the style property of your map in Mapbox GL JS to your url

How to put pie charts on a SVG map?

I use such a map on my website, it's created by amCharts:
All regions are SVG path elements. I'm thinking how to put a chart.js (or any other) pie chart on each of them. The chart of chart.js is a canvas element. Is there any easy solution to achieve it? I could also change the map provider if neccessary.
This should be the effect:
There's a demo on the AmCharts website that shows how to do that. You essentially need to create image markers that you can place on your map using latitude and longitude coordinates and use the positionChanged event to create/update custom external divs which contain your pie charts.

Does leaflet allow me to control the types of roads shown?

I want to control which types of roads show from this OSM highways list at various zoom levels.
I could not find the answer in the Leaflet docs. If you do, please link me.
edit:
Maybe i need to go one step back in the making stack and use one of these frameworks? http://wiki.openstreetmap.org/wiki/Frameworks#Generating_map_images
It is not possible to alter displayed map style in Leaflet.
Probably the fastest way to achieve your goal is:
Create your map style in Mabox Studio, where you will specify the road types to be displayed at various zoom levels. Mapbox will render the map tiles for you and expose them via URL.
then display the tiles created in Mapbox Studio in Leaflet (or Mapbox.js which is build above leaflet) simply by altering the map tiles URL you use when you initialize leaflet.

Mapbox and leaflet for custom centering

Im sorry if this question is for dummies.
I'm using mapbox on a web development and I have "side" panels next to my map.
The thing is that I want to center the map on a location that I capture by double clicking it.
I know that map.setView([lat,lng],number) or map.panTo([lat,lng]) do the centering magic, but they do it over the actual size of the map o div width.
I want to know if anyone knows if I can do a custom centering, like using the same map size but the center "calculation" occurs on the left or right half of the map.
I dont know how to catch this "resolution" all I know is that I need the half of the width that the map uses. Here is an image of what I want to do enter image description here
(probably a duplicate question with that one on GIS StackExchange: Change the center point of leaflet)
You will probably be interested in one of those plugins:
Leaflet-active-area
This plugin allows you to use a smaller portion of the map as an active area. All positioning methods (setView, fitBounds, setZoom) will be applied on this portion instead of the all map.
Leaflet.ControlledBounds
Inspired by Leaflet-active-area, automatically detects the largest area of the map not covered by any map controls and applies setView, fitBounds, setZoom, getBounds to that area.
finally I figured out how to center the panTo() the way i wanted.
i used this
myLayer.on('click',function(e){
var vista=$('#map').width()/4;
map.setView(new L.LatLng(e.latlng.lat, e.latlng.lng),15);
map.panBy([-vista,0]);}

Make google maps polyline appear below street names?

I'm making a subway map. The "transit" option on the official google maps shows their polyline below street/town names, but I can't figure out how to make mine do the same. Changing the zIndex to 0 (or negative numbers) doesn't work. Anyone know how to do this? Thanks.
Google Maps has several panes where the map components are being placed. Unfortunately for you the map tiles are placed below all those panes. Z-index has no effect if something is in higher pane, it only affects the order of overlays in the same pane.
Moreover map tiles are single images where all the map data are rendered. Therefore you can't place an overlay below some of the data rendered on the map tiles.
Theoretically, there might be a way to achieve this, but it's very difficult and I'm not even sure if it would work. Using styled maps you could create a base map type and an overlay map type. And then you could try to place the polylines between those two map types. Be sure there are many drawbacks:
I haven't tried to use styled map as an overlay map type so I'm not sure it would work.
Overlay map type is placed in the lowest map pane just above the base map. But polylines that are offered by Google Maps are rendered in higher pane and you can't place them into the lowest map pane.
Therefore it would be necessary to create your own special overlay layer or overlay map type containing the polylines. That is a lot of work! And then add it to the lowest map pane below the overlay map type.
OK, that's theory. Lots of hacking and uncertain outcome. I wouldn't do it that way!

Categories

Resources