QML Mapbox with custom sprite
-
wrote on 6 May 2019, 04:44 last edited by
Hi.
I am struggling using a custom sprite with Mapbox.
My custom sprite and json descriptions are available online, i added thisMapParameter { type: "image" property var name: "mySprite" property var sprite: "https://url-to-sprite" }
and later use it in a style-layer with a layout
MapParameter { id: mylocationlayout type: "layout" property var layer: "myLocationLayer" property var iconImage: "myicon" }
it gives me:
[ ERROR ] "{unknown}[Style]: Failed to load sprite: HTTP status code 404"
ok, it cannot find the sprite, but why? and how to make it work?
the same url is also used in the mapbox-style itself...i am not sure with that "sprite" property, and also tried "url", with the same result.
thanks for any help
-
wrote on 2 Aug 2019, 11:48 last edited by
I ended up not using online-sprites but load the sprites in QML:
MapParameter { type: "image" property var name: "mySprite" property var sprite: ":/path_to_iamge_in_resources" }
using it in a layout like this:
MapParameter { type: "layout" property var layer: "myLayer" property var iconImage: "mySprite" }