diff --git a/api/dist/apihelp/data.txt b/api/dist/apihelp/data.txt index bffc025d4040..8866fe7180a3 100644 --- a/api/dist/apihelp/data.txt +++ b/api/dist/apihelp/data.txt @@ -1,6 +1,6 @@ -id point title description icon -1 553000,216300 Information Office de l'information
Tél: 032 000 00 00
Email: info@example.com
Internet: Cliquer ici http://dev.openlayers.org/releases/OpenLayers-2.13.1/img/marker.png -2 554250,215600 Ma première station Diesel pas cher http://dev.openlayers.org/releases/OpenLayers-2.13.1/img/marker-blue.png -3 552556,215864 Mon parking C'est celui-là le meilleur. http://dev.openlayers.org/releases/OpenLayers-2.13.1/img/marker-gold.png -4 554489,217126 Mon parking Ce parking est
le meillleur. http://dev.openlayers.org/releases/OpenLayers-2.13.1/img/marker-gold.png -5 554089,217326 Ma deuxième station Sans-plomb pas cher. http://dev.openlayers.org/releases/OpenLayers-2.13.1/img/marker-blue.png +id point title description icon iconSize iconOffset +1 553000,216300 Information Office de l'information
Tél: 032 000 00 00
Email: info@example.com
Internet: Cliquer ici http://dev.openlayers.org/releases/OpenLayers-2.13.1/img/marker.png 21,25 -10.5,-25 +2 554250,215600 Ma première station Diesel pas cher http://dev.openlayers.org/releases/OpenLayers-2.13.1/img/marker-blue.png 21,25 -10.5,-25 +3 552556,215864 Mon parking C'est celui-là le meilleur. http://dev.openlayers.org/releases/OpenLayers-2.13.1/img/marker-gold.png 21,25 -10.5,-25 +4 554489,217126 Mon parking Ce parking est
le meillleur. http://dev.openlayers.org/releases/OpenLayers-2.13.1/img/marker-gold.png 21,25 -10.5,-25 +5 554089,217326 Ma deuxième station Sans-plomb pas cher. http://dev.openlayers.org/releases/OpenLayers-2.13.1/img/marker-blue.png 21,25 -10.5,-25 diff --git a/api/src/Map.js b/api/src/Map.js index d716c30dda8d..d5754d0e4ab7 100644 --- a/api/src/Map.js +++ b/api/src/Map.js @@ -299,10 +299,16 @@ class Map { }); marker.setProperties(filterByKeys(values, attr)); marker.setId(values.id); - // FIXME: handle values.iconSize - // FIXME: handle values.iconOffset + let anchor; + if (values.iconOffset) { + // flip the sign of the value to be compatible with the old api. + anchor = values.iconOffset.split(',').map(parseFloat).map(val => val * Math.sign(val)); + } const image = new Icon({ - src: values.icon + src: values.icon, + anchorXUnits: 'pixels', + anchorYUnits: 'pixels', + anchor: anchor }); // @ts-ignore: OL issue marker.setStyle(new Style({ diff --git a/contribs/gmf/src/print/component.js b/contribs/gmf/src/print/component.js index 18e99904acba..9f106e0ff2c1 100644 --- a/contribs/gmf/src/print/component.js +++ b/contribs/gmf/src/print/component.js @@ -1380,6 +1380,7 @@ class Controller { */ getMetadataLegendImage_(layerName, dpi = 72) { const groupNode = findGroupByLayerNodeName(this.currentThemes_, layerName); + let found_dpi = dpi; let node; if (groupNode && groupNode.children) { node = findObjectByName(groupNode.children, layerName); @@ -1393,6 +1394,7 @@ class Controller { let dist = Number.MAX_VALUE; if (legendImage) { dist = Math.abs(Math.log(72 / dpi)); + found_dpi = 72; } if (hiDPILegendImages) { for (const str_dpi in hiDPILegendImages) { @@ -1400,7 +1402,7 @@ class Controller { const new_dist = Math.abs(Math.log(new_dpi / dpi)); if (new_dist < dist) { dist = new_dist; - dpi = new_dpi; + found_dpi = new_dpi; legendImage = hiDPILegendImages[str_dpi]; } } @@ -1410,7 +1412,7 @@ class Controller { } return { url: legendImage, - dpi: dpi, + dpi: found_dpi, }; }