CartoDB / mobile-sdk

CARTO Mobile SDK core project
https://carto.com/docs/carto-engine/mobile-sdk/
BSD 3-Clause "New" or "Revised" License
184 stars 65 forks source link

Creating a style #485

Open ravenfeld opened 2 years ago

ravenfeld commented 2 years ago

Hello, I'm trying to make a style for a vector mbtiles map. I used the site https://studio.mapbox.com/ after reading the following page https://github.com/CartoDB/mobile-sdk/wiki/Creating-custom-basemap-styles.

The problem is that I have a CartoCSS style loading failed: "type mismatch! call is() before get()" && is().

All styles that are made with the software do not work. Is it the doc that is not up to date or me that did not understand how to do it.

Thanks in advance.

mtehver commented 2 years ago

Hi. Could you share your style? From the description I would guess one of the fields in your 'project.json' file has wrong type.

ravenfeld commented 2 years ago

Outdoors.zip For example the outdoors style. I would like to display it.

mtehver commented 2 years ago

This style seems to be created with new MapBox Studio, not with MapBox Studio Classic. CARTO Mobile SDK uses extended CartoCSS styling language, not the MapBox properitary JSON-based format.

There is no easy way to convert one to another. If you need a fully featured 'outdoors' style, you can find one here: https://github.com/farfromrefug/new_carto_theme

Instructions how to use it can be found here: https://github.com/mtehver/new_carto_theme/tree/optimizations

ravenfeld commented 2 years ago

thank you very much, I've already tried but it doesn't render what I'd like and some information is missing but maybe it's my mbtiles that doesn't work with the styles.

mtehver commented 2 years ago

@ravenfeld Perhaps your mbtiles file uses MapBox layer structure, not OpenMapTiles structure. MapBox Vector Tiles (MVT) format is a generic container format that describes how to encode layers and features, but leaves details open. CARTO uses OpenMapTiles layer structure which is different from MapBox. Thus OpenMapTiles mbtiles files will not be rendered correctly when used in MapBox SDK and MapBox mbtiles will not be rendered correctly when used in CARTO Mobile SDK.

ravenfeld commented 2 years ago

I did not know I use this https://github.com/systemed/tilemaker, but maybe the default configuration does not allow to display some things.

farfromrefug commented 2 years ago

@ravenfeld you should.use openmaptiles to generate your mbtiles. it is the closest to mapbox and is compatible with maptiler vector tiles

ravenfeld commented 2 years ago

Thanks, that's what I used but I'm having trouble rendering the names but I'll keep trying to figure it out.

farfromrefug commented 2 years ago

@ravenfeld i use my own fork of openmaptiles https://github.com/Akylas/openmaptiles. I keep only name and remove all name_en, name_de ....