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…)