lizmap-web-client icon indicating copy to clipboard operation
lizmap-web-client copied to clipboard

[BUG/workaround] Change color selection in QGIS does not change selection or highlighting in LWC

Open jlstanus opened this issue 7 years ago • 18 comments

Master branch, QGIS 2.18

When i change the color selection in QGIS project properties, the color does not change in the LWC (selection or highlighting). The color stays in yellow. Maybe CSS could override?

In HTML i see

<path id="OpenLayers_Geometry_Polygon_1917" d=" M 637.6069366662632,335 .........................."
fill-rule="evenodd" fill="none" stroke="yellow" stroke-opacity="1" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"></path>

I edit it manually, it's ok.. but how to add it to a theme? I added this in projectdirectory/media/css/map.css

path[id^="OpenLayers_Geometry_Polygon_"] ,path[id*=" OpenLayers_Geometry_Polygon_"] 
{
	stroke: blue;
}

No results

jlstanus avatar Jan 23 '18 08:01 jlstanus

hi @jlstanus

i think it's not a bug but an enhancement for LWC

josemvm avatar Jan 23 '18 12:01 josemvm

@josemvm hi. Maybe :-P but i don't know how to use. if you have a tip, i can add the explication to the documentation.

jlstanus avatar Jan 23 '18 14:01 jlstanus

@jlstanus i have no tips to offer on this issue :-( i think it could be a good improvement!

josemvm avatar Jan 23 '18 17:01 josemvm

@josemvm , ok i keep you in touch ;) thank you

jlstanus avatar Jan 24 '18 08:01 jlstanus

The selection color in Lizmap is contained in the image given by QGIS Server. This is probably related to QGIS not using the selection color defined in the project properties for the getMap WMS request

mdouchin avatar Jan 24 '18 09:01 mdouchin

@mdouchin OK

As workaround for the highlighting, i edited this in map.js

      $('#locate .menu-content').html(locateContent.join('<br/>'));
      map.addLayer(new OpenLayers.Layer.Vector('locatelayer',{
        styleMap: new OpenLayers.StyleMap({
          pointRadius: 6,
          fill: false,
          stroke: true,
          strokeWidth: 7,
          strokeColor: 'DarkMagenta'

By example: I replaced yellow by DarkMagenta and 3 by 7

jlstanus avatar Jan 24 '18 11:01 jlstanus

Second workaround is to use media/themes/default/css and add the map.css with this content :

path[id*="OpenLayers_Geometry_Polygon_"] {
  stroke : DarkMagenta
 }

jlstanus avatar Jun 06 '18 06:06 jlstanus

i saw this pull request https://github.com/qgis/QGIS/pull/7294 by @rldhont on QGIS Server 2.18.21 but the LWC still doesn´t use the selection color (on display and on print)...

josemvm avatar Oct 01 '18 11:10 josemvm

realted to https://github.com/3liz/lizmap-web-client/issues/288

josemvm avatar Oct 01 '18 11:10 josemvm

  • on display always uses the yellow color
  • on print always uses the feature color, it doesn't print selection (this implies that the only way to highlight a feature is to use a filter, losing all the rest of the layer features...)

josemvm avatar Oct 01 '18 12:10 josemvm

see here https://github.com/qgis/QGIS/pull/7185 for the capability to print selection with Server 2.18

thanks

josemvm avatar Oct 01 '18 12:10 josemvm

@rldhont what can say about these issues related to print selection with Server 2.18(.24) ? thanks

josemvm avatar Oct 18 '18 10:10 josemvm

The selection print is available since QGIS 2.18.21 and the use of project selection color in print is also available since QGIS 2.18.21.

rldhont avatar Oct 18 '18 10:10 rldhont

i'm talking about the lizmap capabilities to explore these features (?)

josemvm avatar Oct 18 '18 10:10 josemvm

https://github.com/3liz/lizmap-web-client/issues/464

josemvm avatar Oct 18 '18 10:10 josemvm

If no mistake, this is working now.

Gustry avatar Jul 18 '23 15:07 Gustry

This issue is missing some feedbacks. 👻 Please have a look to the discussion, thanks. 🦎

3liz-bot avatar Oct 17 '23 04:10 3liz-bot

The selection made by QGIS Server works but we should use the color defined in the QGIS project also for the highlight layer used in several tools (search, atlas etc.). Ref: https://github.com/3liz/lizmap-web-client/pull/4025

nboisteault avatar Dec 21 '23 13:12 nboisteault