From d07ec38cb75a0b408f0c25f992719ebf75fd486c Mon Sep 17 00:00:00 2001 From: nboisteault Date: Fri, 17 Oct 2025 10:49:15 +0200 Subject: [PATCH 1/2] Feat: geolocation add orientation arrow --- assets/src/modules/Geolocation.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/assets/src/modules/Geolocation.js b/assets/src/modules/Geolocation.js index 87395c0ed1..e2223b6b57 100644 --- a/assets/src/modules/Geolocation.js +++ b/assets/src/modules/Geolocation.js @@ -12,6 +12,8 @@ import { Vector as VectorLayer } from 'ol/layer.js'; import Point from 'ol/geom/Point.js'; import Circle from 'ol/geom/Circle.js'; import Feature from 'ol/Feature.js'; +import Style from 'ol/style/Style.js'; +import Icon from 'ol/style/Icon.js'; /** * @class @@ -236,6 +238,16 @@ export default class Geolocation { geometry: new Point(coordinates) }); + const iconStyle = new Style({ + image: new Icon({ + src: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHZpZXdCb3g9IjAgMCAxNzkyIDE3OTIiIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiI+CiAgPHBhdGggZD0iTTE4OCAxNjU5IDg5NiAxMzNsNzA4IDE1MjYtNzA4LTM3M3oiLz4KPC9zdmc+Cg==', // eslint-disable-line + rotation: this._geolocation.getHeading(), + rotateWithView: true, + }), + }); + + positionFeature.setStyle(iconStyle); + const accuracyFeature = new Feature({ geometry: new Circle(coordinates, this._geolocation.getAccuracy() / 2) }); From 50027d8760c416d70e35bed5feaf5d8d9f750cf2 Mon Sep 17 00:00:00 2001 From: nboisteault Date: Fri, 17 Oct 2025 10:50:39 +0200 Subject: [PATCH 2/2] e2e: update geolocation project --- tests/qgis-projects/tests/geolocation.qgs | 71 ++++++++++++++----- tests/qgis-projects/tests/geolocation.qgs.cfg | 24 +++++-- 2 files changed, 70 insertions(+), 25 deletions(-) diff --git a/tests/qgis-projects/tests/geolocation.qgs b/tests/qgis-projects/tests/geolocation.qgs index df8714c76b..9fa3fe4abc 100644 --- a/tests/qgis-projects/tests/geolocation.qgs +++ b/tests/qgis-projects/tests/geolocation.qgs @@ -1,4 +1,4 @@ - + @@ -16,6 +16,20 @@ false + + + + + 0 + 0 + + + + + false + + + @@ -26,7 +40,7 @@ - + @@ -85,7 +99,7 @@ - + Annotations_b12e8ca5_4086_4f94_95af_3e00b49d1450 @@ -113,6 +127,7 @@ + @@ -131,12 +146,21 @@ + + 1 + 1 + 1 + 0 + + + + 1 0 - + -20037508.34278924390673637 -20037508.34278924763202667 @@ -146,11 +170,11 @@ -180 -85.05112877980660357 - 179.99999999999997158 + 180 85.05112877980660357 OpenStreetMap_ab9cd479_708a_4147_a0b1_2508e7ba864c - type=xyz&url=https://tile.openstreetmap.org/{z}/{x}/{y}.png&zmax=19&zmin=0 + crs=EPSG:3857&format&type=xyz&url=https://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png&zmax=19&zmin=0 OpenStreetMap @@ -180,6 +204,7 @@ + Fond de carte et données d’OpenStreetMap et de la Fondation OpenStreetMap (CC-BY-SA). © les contributeurs de https://www.openstreetmap.org. Open Data Commons Open Database License (ODbL) @@ -216,13 +241,13 @@ 1 0 - + - + @@ -239,7 +264,7 @@ - + @@ -251,7 +276,7 @@ - + @@ -288,15 +313,15 @@ - + - + - + @@ -318,6 +343,7 @@ + @@ -351,6 +377,7 @@ + 0 @@ -380,6 +407,7 @@ 5 2.5 + false false false 1 @@ -388,7 +416,7 @@ false true 0 - 255,0,0,255 + 255,0,0,255,rgb:1,0,0,1 false @@ -501,6 +529,9 @@ + + + nboisteault 2024-01-05T16:45:15 @@ -508,9 +539,10 @@ + - + PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]] +proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs @@ -524,11 +556,11 @@ - + - - + + @@ -575,4 +607,7 @@ + + + diff --git a/tests/qgis-projects/tests/geolocation.qgs.cfg b/tests/qgis-projects/tests/geolocation.qgs.cfg index c65ae9dd38..11b9c04cd0 100644 --- a/tests/qgis-projects/tests/geolocation.qgs.cfg +++ b/tests/qgis-projects/tests/geolocation.qgs.cfg @@ -1,14 +1,17 @@ { "metadata": { - "qgis_desktop_version": 32814, - "lizmap_plugin_version_str": "4.1.3-alpha", - "lizmap_plugin_version": 40103, - "lizmap_web_client_target_version": 30800, - "lizmap_web_client_target_status": "Stable", + "qgis_desktop_version": 34011, + "lizmap_plugin_version_str": "4.5.4", + "lizmap_plugin_version": 40504, + "lizmap_web_client_target_version": 31100, + "lizmap_web_client_target_status": "Dev", "instance_target_url": "http://localhost:8130/", "instance_target_repository": "testsrepository" }, "warnings": {}, + "debug": { + "total_time": 0.253 + }, "options": { "projection": { "proj4": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs", @@ -21,6 +24,8 @@ "12514194.88550000078976154" ], "mapScales": [ + 500, + 1000, 10000, 25000, 50000, @@ -31,7 +36,7 @@ 10000000, 50000000 ], - "minScale": 10000, + "minScale": 500, "maxScale": 50000000, "use_native_zoom_levels": false, "hide_numeric_scale_value": true, @@ -47,13 +52,15 @@ "pointTolerance": 25, "lineTolerance": 10, "polygonTolerance": 5, + "automatic_permalink": false, "tmTimeFrameSize": 10, "tmTimeFrameType": "seconds", "tmAnimationFrameLength": 1000, "datavizLocation": "dock", "theme": "dark", "fixed_scale_overview_map": true, - "dataviz_drag_drop": [] + "dataviz_drag_drop": [], + "default_background_color_index": 1 }, "layers": { "baselayers": { @@ -70,6 +77,7 @@ "popupSource": "auto", "popupTemplate": "", "popupMaxFeatures": 10, + "children_lizmap_features_table": true, "popupDisplayChildren": "False", "popup_allow_download": true, "legend_image_option": "hide_at_startup", @@ -103,6 +111,7 @@ "popupSource": "auto", "popupTemplate": "", "popupMaxFeatures": 10, + "children_lizmap_features_table": true, "popupDisplayChildren": "False", "popup_allow_download": true, "legend_image_option": "hide_at_startup", @@ -129,6 +138,7 @@ "popupSource": "auto", "popupTemplate": "", "popupMaxFeatures": 10, + "children_lizmap_features_table": true, "popupDisplayChildren": "False", "popup_allow_download": true, "legend_image_option": "hide_at_startup",