Osclass Support Forums

Osclass plugin support => OpenStreetMaps Plugin => Topic started by: Ivan Kataev on April 08, 2022, 10:23:08 AM

Title: Style
Post 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.
Title: Re: Style
Post by: MB Themes on April 08, 2022, 01:14:18 PM
@Ivan
Sorry not sure what you mean
Title: Re: Style
Post by: Ivan Kataev on April 08, 2022, 03:58:16 PM
Mapbox allows you to customize the appearance of the map.  But in the module, the view does not change.
Title: Re: Style
Post by: MB Themes on April 09, 2022, 07:17:40 AM
Maybe you can inject your own but I was never trying that.
It may also refer to newer API versions
Title: Re: Style
Post by: Vlad7 on April 13, 2022, 11:39:09 AM
You need to create your map at https://account.mapbox.com/access-tokens/ and add it to the plugin
Title: Re: Style
Post by: Vlad7 on April 13, 2022, 12:05:33 PM
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: '&copy; <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: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(osmMap);
Title: Re: Style
Post by: MB Themes on April 13, 2022, 08:20:51 PM
Ok so you meant custom tiles or how is it called, map background?
Title: Re: Style
Post by: Vlad7 on April 14, 2022, 01:42:59 PM
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.