Osclass Support Forums
Osclass plugin support => OpenStreetMaps Plugin => Topic started by: Ivan Kataev on April 08, 2022, 10:23:08 AM
-
How to connect style maps with mapbox?
I saw in the reviews that this is possible.
-
@Ivan
Sorry not sure what you mean
-
Mapbox allows you to customize the appearance of the map. But in the module, the view does not change.
-
Maybe you can inject your own but I was never trying that.
It may also refer to newer API versions
-
You need to create your map at https://account.mapbox.com/access-tokens/ and add it to the plugin
-
In the files home_map, item-map, publish_map, search_map, user_map, you need to find the line
L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=<?php echo osm_param('token'); ?>', {maxZoom: 18, id: 'mapbox/streets-v11', attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(osmMap);
'mapbox/streets-v11' - change it to your map
mine looks like this
L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=<?php echo osm_param('token'); ?>', {maxZoom: 18, id: 'vliertyrtav/ckl8s5rrp1pgg45r8gc1rkaws', attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(osmMap);
-
Ok so you meant custom tiles or how is it called, map background?
-
Ok so you meant custom tiles or how is it called, map background?
This is the style of the card. You can create your own map style and add it to the plugin.