Active Topics

 


Reply
Thread Tools
Posts: 1,414 | Thanked: 7,547 times | Joined on Aug 2016 @ Estonia
#71
Originally Posted by m4r0v3r View Post
i was wondering how I could get the center point on the map after I finish scrolling
Depends on the app that you use. For Poor Maps GL, double click anywhere on the map should center you at the current location.
 

The Following User Says Thank You to rinigus For This Useful Post:
Posts: 1,746 | Thanked: 1,832 times | Joined on Dec 2010
#72
Originally Posted by rinigus View Post
Depends on the app that you use. For Poor Maps GL, double click anywhere on the map should center you at the current location.
sorry I mean how do I get the centre coords. I have a pin in the center of the screen, I move the map underneath the pin so lat and lng will change. how can I get the lat lng the pin is now at?
 

The Following User Says Thank You to m4r0v3r For This Useful Post:
Posts: 1,414 | Thanked: 7,547 times | Joined on Aug 2016 @ Estonia
#73
Originally Posted by m4r0v3r View Post
sorry I mean how do I get the centre coords. I have a pin in the center of the screen, I move the map underneath the pin so lat and lng will change. how can I get the lat lng the pin is now at?
Sorry, I misunderstood. I assume that you write an app and want to know API, right?

To get coordinate of any pixel, you call method

Code:
queryCoordinateForPixel(const QPointF p, const QVariant &tag = QVariant())
This method will return immediately and the reply you will get somewhat later (has to go through to other thread and so on) via signal

Code:
replyCoordinateForPixel(const QPointF pixel, QGeoCoordinate geocoordinate, qreal degLatPerPixel, qreal degLonPerPixel, const QVariant &tag)

The signal will carry correct geocoordinate as well as its derivative per pixel (if you wish to apply some sensitivity analysis to the result).

See query example at https://github.com/rinigus/mapbox-gl...es-and-signals

So, in your case, find pixel coordinates of the pin and ask for its geolocation using queryCoordinateForPixel
 

The Following User Says Thank You to rinigus For This Useful Post:
Posts: 1,746 | Thanked: 1,832 times | Joined on Dec 2010
#74
Originally Posted by rinigus View Post
Sorry, I misunderstood. I assume that you write an app and want to know API, right?

To get coordinate of any pixel, you call method

Code:
queryCoordinateForPixel(const QPointF p, const QVariant &tag = QVariant())
This method will return immediately and the reply you will get somewhat later (has to go through to other thread and so on) via signal

Code:
replyCoordinateForPixel(const QPointF pixel, QGeoCoordinate geocoordinate, qreal degLatPerPixel, qreal degLonPerPixel, const QVariant &tag)

The signal will carry correct geocoordinate as well as its derivative per pixel (if you wish to apply some sensitivity analysis to the result).

See query example at https://github.com/rinigus/mapbox-gl...es-and-signals

So, in your case, find pixel coordinates of the pin and ask for its geolocation using queryCoordinateForPixel
ahhh okay thanks and yeahh making an app here


https://github.com/ghosalmartin/harbour-uber
 

The Following 2 Users Say Thank You to m4r0v3r For This Useful Post:
Posts: 58 | Thanked: 223 times | Joined on Apr 2017 @ Germany
#75
Originally Posted by rinigus View Post
@jdrescher, would you mind to test whether it fixed also the issues woth longer workouts?
Hi rinigus, I have tested your bugfix release.
First I setup an environment to reproduce the problem. For that I used Laufhelden 0.9.8-9 and mapboxgl-qml-1.1.1-10.29.1. Then I put an autosave file of a large workout into the /Laufelden directory and then started the app.
Then while loading the autosave the app crashed.

Then I just switched to your new release mapboxgl-qml-1.1.2-10.31.1. everything else I left untouched. When I now start the app, it still freezes for about 30 seconds, but then it recoveres and starts working normally.

So I can say: bug fixed, good job!
 

The Following 3 Users Say Thank You to jdrescher For This Useful Post:
Posts: 1,414 | Thanked: 7,547 times | Joined on Aug 2016 @ Estonia
#76
Originally Posted by jdrescher View Post
Hi rinigus, I have tested your bugfix release.
First I setup an environment to reproduce the problem. For that I used Laufhelden 0.9.8-9 and mapboxgl-qml-1.1.1-10.29.1. Then I put an autosave file of a large workout into the /Laufelden directory and then started the app.
Then while loading the autosave the app crashed.

Then I just switched to your new release mapboxgl-qml-1.1.2-10.31.1. everything else I left untouched. When I now start the app, it still freezes for about 30 seconds, but then it recoveres and starts working normally.

So I can say: bug fixed, good job!
Thank you for testing!
 

The Following 2 Users Say Thank You to rinigus For This Useful Post:
Posts: 58 | Thanked: 223 times | Joined on Apr 2017 @ Germany
#77
Originally Posted by rinigus View Post
When this happens, the client programs would have to enable layout properties for the symbols that they wish to keep always visible
I am working on making my app compatible to the new requirements. Just to make sure that I do it right, here is an example:
Code:
//This is the first data point, draw the start icon
map.addSourcePoint("pointStartImage",  trackLoader.trackPointAt(i));
map.addImagePath("imageStartImage", Qt.resolvedUrl("../img/map_play.png"));
map.addLayer("layerStartLayer", {"type": "symbol", "source": "pointStartImage"});
map.setLayoutProperty("layerStartLayer", "icon-image", "imageStartImage");
map.setLayoutProperty("layerStartLayer", "icon-size", 1.0 / map.pixelRatio);
map.setLayoutProperty("layerStartLayer", "visibility", "visible");
map.setLayoutProperty("layerStartLayer", "icon-allow-overlap", true);
 

The Following 2 Users Say Thank You to jdrescher For This Useful Post:
Posts: 1,414 | Thanked: 7,547 times | Joined on Aug 2016 @ Estonia
#78
Originally Posted by jdrescher View Post
I am working on making my app compatible to the new requirements. Just to make sure that I do it right, here is an example:
It looks fine. You don't need to specify "visibility" since its visible by default anyway
(https://www.mapbox.com/mapbox-gl-js/...bol-visibility). However, its a good idea to allow overlap in this case, since you change the default (https://www.mapbox.com/mapbox-gl-js/...-allow-overlap). So, the code would be:

Code:
//This is the first data point, draw the start icon
map.addSourcePoint("pointStartImage",  trackLoader.trackPointAt(i));
map.addImagePath("imageStartImage", Qt.resolvedUrl("../img/map_play.png"));
map.addLayer("layerStartLayer", {"type": "symbol", "source": "pointStartImage"});
map.setLayoutProperty("layerStartLayer", "icon-image", "imageStartImage");
map.setLayoutProperty("layerStartLayer", "icon-size", 1.0 / map.pixelRatio);
map.setLayoutProperty("layerStartLayer", "icon-allow-overlap", true);
 

The Following 3 Users Say Thank You to rinigus For This Useful Post:
Posts: 1,414 | Thanked: 7,547 times | Joined on Aug 2016 @ Estonia
#79
The plugin has been updated to 1.2.0. Its still on the same QMapboxGL version, I am waiting for the next QMapboxGL release to update it.

Version 1.2.0 brings enhancements:

* allow fixing zoom levels to integers. Suggested and implemented by @otsaloma to provide better support for raster maps

* allow clearing cache (suggested by @otsaloma)

New version is out at OBS and OpenRepos.
 

The Following 4 Users Say Thank You to rinigus For This Useful Post:
olf's Avatar
Posts: 304 | Thanked: 1,246 times | Joined on Aug 2015
#80
Hello @ringius (and @jdrescher, @otsaloma, @MartinK),

Background:
I was surprised to find mapboxgl-qml installed on my Jolla 1 phone. While OSMscout server, PoorMaps, ModRana and Laufhelden are installed, PoorMaps GL and associated libraries were not installed (at least not manually and deliberately).
Looking for the reason, I found that Laufhelden's RPM Spec-file pulls in mapboxgl-qml unconditionally.

As supposedly mapboxgl-qml was already installed for some time and I did not experience any effects, I wonder:
  • May mapboxgl-qml cause any negative effects on Jolla 1 phones, besides the disk space used and having another RPM installed (plus eventual dependencies)?
  • Can mapboxgl-qml be of any use on Jolla 1 phones (i.e. albeit slow, is this technically feasible at all)?
  • If not, why does it install at all (in an unsupported environment)?
These questions are aiming in two directions:
  • How should authors of software handle a potential dependency on mapboxgl-qml, which varies with the environment (i.e. device / installed libraries)?
  • Is there any chance of enabling mapboxgl-qml to run on Jolla 1 phones (no matter how slow)?
Many thanks to you all for your marvelous work!

Last edited by olf; 2018-03-09 at 17:20.
 

The Following 3 Users Say Thank You to olf For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 12:46.