go-spatial / tegola

Tegola is a Mapbox Vector Tile server written in Go
http://tegola.io/
MIT License
1.25k stars 192 forks source link

Serve vector tiles using Tegola and Maplibre-gl-native on android app #912

Closed AmirDotDev0 closed 1 year ago

AmirDotDev0 commented 1 year ago

Hello tegola community, I've been trying to use tegola vector tiles on my android app using maplibre-gl-native, the server is working fine and my app working fine the problem is with the style, screenshot below:

Screenshot_20230314_135214_com clone uberclone

I want it to look like mapbox, the tutorial example on tegola website showed how to use tegola with maplibre-gl-js by using styles from maplibre server and I have to get an access token, the only reason I wanted to self-host tegola and use open source solution like maplibre-gl-native is because I don't want to use external services, I already managed to do this using Tileserver-gl which allows me to add a styled map to maplibre-gl-native without using an external service. Anyone can help???

The below screenshot is the same app using maplibre-gl-native and tileserver-gl as the tile server without using any external styles or services

Screenshot_20230314_140930_com clone uberclone

ARolek commented 1 year ago

I want it to look like mapbox, the tutorial example on tegola website showed how to use tegola with maplibre-gl-js by using styles from maplibre server and I have to get an access token, the only reason I wanted to self-host tegola and use open source solution like maplibre-gl-native is because I don't want to use external services, I already managed to do this using Tileserver-gl which allows me to add a styled map to maplibre-gl-native without using an external service. Anyone can help???

It looks like you just need a different style definition. Mapbox's dataset is probably richer than what you're going to get from the getting started guide but you should be able to get close. Here are some resources:

A very important detail is that you must design the data schema of your vector tiles to match that of your style sheet. Cartography is a deep topic and you will likely be tweaking the style for a long time. It's also quite fun to play with. I'm going to tag @PetersonGIS as she authored most of the styles I referenced above.

AmirDotDev0 commented 1 year ago

Hey, thanks for the help the styles you provided really helped, but there is a problem with the labels, the map on the website showed all street names including names in Arabic but when I use the style on my android app with maplibre-gl-native the Arabic labels didn't show up, also when I use my own osm data source url (I replaced this "https://tegola-osm-demo.go-spatial.org/v1/capabilities/osm.json" with this "http://localhost/capabilities/osm.json") everything works fine but some labels are missing and Arabic labels are not showing up, here is a screenshot:

Screenshot_20230315_100227_com clone uberclone

The screenshot above shows my app after replacing osm data source URL with my own.

I wonder why some labels are missing, is it an issue with my PostGIS database, I got the data from "http://download.geofabrik.de/" and used imposm to import data to PostGIS, is there something wrong with my database or there is something I'm missing.

Edit: I tried using my osm data source URL on the web and its working, Arabic labels showed up on the website here is a screenshot:

Untitled

So why Arabic labels works on the web but they don't work on my android app, is the problem with maplibre-gl-native?

ARolek commented 1 year ago

So why Arabic labels works on the web but they don't work on my android app, is the problem with maplibre-gl-native?

If you can see the labels correctly on web, but not native, and you're using the same tile source then this is likely a client side issue. You might need to look at what fonts are available on Android.

I'm going to close this issue as this appears to be on the client side rather than an issue with tegola.