comparison client/src/components/map/styles.js @ 3390:8adf1fc51acd

client: spuc05: improved diagram size on map
author Markus Kottlaender <markus@intevation.de>
date Wed, 22 May 2019 16:53:31 +0200
parents 2d90ec061458
children e56b280582ae
comparison
equal deleted inserted replaced
3389:45a629a3a8b8 3390:8adf1fc51acd
190 if ( 190 if (
191 feature.get("fa_critical") && 191 feature.get("fa_critical") &&
192 feature.get("fa_data") && 192 feature.get("fa_data") &&
193 resolution > 15 193 resolution > 15
194 ) { 194 ) {
195 let frame = `<rect x='0' y='0' width='40' height='104' stroke-width='0' fill='white'/>`; 195 let frame = `<rect x='0' y='0' width='32' height='84' stroke-width='0' fill='white'/>`;
196 let lnwl = `<rect x='2' y='22' width='18' height='80' stroke-width='0' fill='aqua'/>`; 196 let lnwl = `<rect x='2' y='22' width='10' height='60' stroke-width='0' fill='aqua'/>`;
197 let range1 = `<rect x='20' y='2' width='18' height='10' stroke-width='0' fill='hotpink'/>`; 197 let range1 = `<rect x='12' y='2' width='18' height='25' stroke-width='0' fill='hotpink'/>`;
198 let range2 = `<rect x='20' y='12' width='18' height='30' stroke-width='0' fill='darksalmon'/>`; 198 let range2 = `<rect x='12' y='27' width='18' height='5' stroke-width='0' fill='darksalmon'/>`;
199 let range3 = `<rect x='20' y='42' width='18' height='60' stroke-width='0' fill='blue'/>`; 199 let range3 = `<rect x='12' y='32' width='18' height='50' stroke-width='0' fill='blue'/>`;
200 let svg = `data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='104'><g>${frame}${lnwl}${range1}${range2}${range3}</g></svg>`; 200 let svg = `data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='84'><g>${frame}${lnwl}${range1}${range2}${range3}</g></svg>`;
201 let bnCenter = getCenter(feature.getGeometry().getExtent()); 201 let bnCenter = getCenter(feature.getGeometry().getExtent());
202 s.push( 202 s.push(
203 new Style({ 203 new Style({
204 geometry: new Point(bnCenter), 204 geometry: new Point(bnCenter),
205 image: new Icon({ 205 image: new Icon({
206 src: svg, 206 src: svg,
207 anchor: [1.2, 1.2], 207 anchor: [1.2, 1.2]
208 scale: resolution > 100 ? 0.75 : 1
209 }) 208 })
210 }) 209 })
211 ); 210 );
212 } 211 }
213 return s; 212 return s;