|
2017-09-28
, 20:12
|
Posts: 1,414 |
Thanked: 7,547 times |
Joined on Aug 2016
@ Estonia
|
#92
|
import MapboxMap 1.0
|
2017-09-30
, 07:53
|
Posts: 1,414 |
Thanked: 7,547 times |
Joined on Aug 2016
@ Estonia
|
#93
|
|
2017-09-30
, 23:08
|
Posts: 4 |
Thanked: 10 times |
Joined on Sep 2017
|
#94
|
The QML plugin is available at https://build.merproject.org/package...s/mapboxgl-qml . All you have to do is to install it from this repository and you'll get access to
and MapboxMap type in QML.Code:import MapboxMap 1.0
Plugin has been compiled using rpm spec in https://github.com/rinigus/mapbox-gl-qml . If you wish to use these bindings in C++ application, just clone as a submodule the repository and include mapbox-gl-qml.pri into your project, as before.
As far as I tested, the plugin worked with the trivial QML application that had MapboxMap filling Page. This should allow to use this plugin for python-based SFOS apps.
If someone has a better idea on naming the plugin or its distribution, please let me know.
|
2017-10-02
, 07:35
|
Posts: 1,414 |
Thanked: 7,547 times |
Joined on Aug 2016
@ Estonia
|
#95
|
|
2017-10-03
, 00:02
|
Posts: 1,548 |
Thanked: 7,510 times |
Joined on Apr 2010
@ Czech Republic
|
#96
|
I would like to ask for help from QML experts. For interaction with the widget, we need mouse interaction area that would support:
- panning
- pinch to zoom
- flicking
- report single click
- report double click
I have composed something on the basis of demo code that was given by Nokia (if I am not mistaken) which uses PinchArea/MouseArea combination.
In addition, I get "false positive" clicks sometimes when panning and (probably always) when double clicking.
If there is a brave soul that could look into current implementation at https://github.com/rinigus/mapbox-de...pMouseArea.qml and improve it, it will be very much appreciated.
Ideally, I would like to have this code MIT-licensed, so everyone could just reuse it in their projects regardless of their license. Don't know the original license of Nokia-based demo code though ...
Other than mouse interaction, I am making steady progress with porting Poor Maps over to this map widget. The widget's API is developed to make this and future ports easier, as was expected.
|
2017-10-03
, 09:36
|
Posts: 1,414 |
Thanked: 7,547 times |
Joined on Aug 2016
@ Estonia
|
#97
|
[...]
I *think* that if you want flick support in your custom widget and the use case does not fit a built-in container (Flickable, ListView, etc.) you are supposed to implement that yourself.
[...]
Also, one thing to watch for is that the mouse event coordinates are floats and you should convert them to integers as soon as possible before using them for other things. Otherwise bad things will happen - for example if you use them to move two different elements/layers during the pan by adding he position difference to x/y coordinates, the two elements/layers will gradually "float apart" due to floating point errors. All should be fine if you convert the mouse event numbers to integers first.
How do I build & run the demo app on desktop (Fedora 26 in my case)? Just load it to a recent QtCreator or is there more ? Don't really want to promise anything just now though - I'm already working on quite many things in modRana at the same time (routing overlay, making it possible to switch between different map element implementations, general stabilization so that a new modRana release can be made in a reasonably near future, etc.).
|
2017-10-03
, 19:14
|
Posts: 1,548 |
Thanked: 7,510 times |
Joined on Apr 2010
@ Czech Republic
|
#98
|
Your proposed implementation should work, as far as I can see. Seems like current code in modRana and in the demo are similar and the both lack flicking support.
In the case of MapboxMap widget, there should be no issue with the floating point errors. Namely, you either plot by defining the map objects (points, roads, ...) or you paint widgets that are moving around according to the map signals (signals tell widgets exact new location in pixels). As such, we have only one center of the map and everything else is relative to that. This prevents different layers to get differently adjusted and works great, as far as I have tested.
Very-very simple (instructions have not been tested in real life, correct as needed):
* clone recursively https://github.com/rinigus/pkg-mapbox-gl-native
* make subdir build
* copy mapbox-gl-native-lib.pro to mapbox-gl-native subdir
* in build subdir, qmake5 ../mapbox-gl-native/mapbox-gl-native-lib.pro
* make -jXX
* clone https://github.com/rinigus/mapbox-gl-qml
* open in QtCreator mapbox-gl-qml/app/mapbox-qml.pro
* Adjust mapbox-qml.pro (https://github.com/rinigus/mapbox-gl...ox-qml.pro#L12 ) INCLUDEPATH and LIBS to point to pkg-mapbox-gl-native/build and pkg-mapbox-gl-native/mapbox-gl-native location accordingly.
* Should compile and run from the creator. To run outside, adjust LD_LIBRARY_PATH if needed.
To run in modRana, you would have to install the QML extension. This is done via https://github.com/rinigus/mapbox-gl...box-gl-qml.pro - here you probably can just comment out QMAKE_XXX vars.
NB! I don't know what's gcc is on Fedora - you need decent c++14 support. Probably gcc 4.9 is fine, but I am not 100% sure. If the support is insufficient, pkg-mapbox-gl-native build will fail.
|
2017-10-03
, 19:33
|
Posts: 1,414 |
Thanked: 7,547 times |
Joined on Aug 2016
@ Estonia
|
#99
|
Well, we have GCC 7.2.1 in Fedora 26, so I think we are covered. ;-)
|
2017-10-04
, 20:37
|
Posts: 339 |
Thanked: 1,623 times |
Joined on Oct 2013
@ France
|
#100
|
When I have something functional, I'll try to ask a friend who is a designer to help me pick a better color palette !