Simple way to Display GeoJSON Shapes (with GPS-Mark for current possition)

I would be Happy for Input on this Topic if someone knows a little about it or has some Idea. The solution should be Harbour compatible. All Input to steer my thoughts in a good direction are welcome! :smiley:

I want to display the shapes of one or several GeoJSON-Files somehow in a scroll- and zoom-able component in a QML/Silica Application. On a click into a shape, I want to create an action, that displays for example more content for this shape.

Further I would like to display in the End an Indication of the current GPS position.

So in fact it is a really, really basic ā€œMapsā€ application. But Iā€™m not sure what are the best components to look into to realize that. I even thought about creating something that is feed to a browser view for that task. But Iā€™m sure there are smarter ways to do that. Any Ideas welcome :slight_smile:

2 Likes

I did this long ago for a parking ticket app, but never published this part.

Keep in mind, this was my first app I ever wrote so the style may be not exactly ā€œbest practiceā€ :grimacing: ā€¦and Iā€™m not sure if the Map item is even still available on SailfishOS.

1 Like

This looks Interesting, Iā€™ll study it a little.

Iā€™m not sure, if the Map item is from Silica (i donā€™t think soā€¦) or from QtPositioning (which is available for Harbour) or QtLocation (which isnā€™t).

EDIT: It is from QtLocation, so no way for Harbour compliant Apps at the moment i thinkā€¦ QtLocation since 5.13 would have a GeoJSON component as well.

There was a lot of talk about maps and qtlocation in the community meetings. @rinigus should be competent in this topic.

1 Like

Yeah, Iā€™m aware. I thought, as I donā€™t really need underlying ā€˜Mapā€™ with Map Tiles etc., there could be a smart and easy solution that I didnā€™t think about yetā€¦ At least I hope there is :wink:

I played around with it today. It works for ā€˜non-harbourā€™ applications with
- qt5-qtdeclarative-import-location in the .yaml-file and import QtLocation in the .qml-file.
However, as expected, the rpm-validator does not accept that for harbour.
Thanks, @michfu for the Ideas so far!

(Btw., https://sailfishos.org/wiki/Positioning indicates somehow that it could be allowed, I would recommend Jolla to change the text thereā€¦)