Mercurial > gemma
comparison client/src/store/map.js @ 2947:a6eea3002e6e
client: cleanup import paths
author | Fadi Abbud <fadi.abbud@intevation.de> |
---|---|
date | Fri, 05 Apr 2019 12:47:35 +0200 |
parents | 173ce013a021 |
children | 1ac58e024942 |
comparison
equal
deleted
inserted
replaced
2946:4141a06961bb | 2947:a6eea3002e6e |
---|---|
22 import Draw from "ol/interaction/Draw.js"; | 22 import Draw from "ol/interaction/Draw.js"; |
23 import { Icon, Stroke, Style, Fill, Text, Circle } from "ol/style.js"; | 23 import { Icon, Stroke, Style, Fill, Text, Circle } from "ol/style.js"; |
24 import VectorSource from "ol/source/Vector.js"; | 24 import VectorSource from "ol/source/Vector.js"; |
25 import Point from "ol/geom/Point.js"; | 25 import Point from "ol/geom/Point.js"; |
26 import { bbox as bboxStrategy } from "ol/loadingstrategy"; | 26 import { bbox as bboxStrategy } from "ol/loadingstrategy"; |
27 import { HTTP } from "../lib/http"; | 27 import { HTTP } from "@/lib/http"; |
28 import { fromLonLat } from "ol/proj"; | 28 import { fromLonLat } from "ol/proj"; |
29 import { getLength, getArea } from "ol/sphere.js"; | 29 import { getLength, getArea } from "ol/sphere.js"; |
30 import { unByKey } from "ol/Observable"; | 30 import { unByKey } from "ol/Observable"; |
31 import { getCenter } from "ol/extent"; | 31 import { getCenter } from "ol/extent"; |
32 import { transformExtent } from "ol/proj.js"; | 32 import { transformExtent } from "ol/proj.js"; |
33 import bbox from "@turf/bbox"; | 33 import bbox from "@turf/bbox"; |
34 import app from "../main"; | 34 import app from "@/main"; |
35 | 35 |
36 const LAYERS = { | 36 const LAYERS = { |
37 OPENSTREETMAP: "Open Streetmap", | 37 OPENSTREETMAP: "Open Streetmap", |
38 INLANDECDIS: "Inland ECDIS chart Danube", | 38 INLANDECDIS: "Inland ECDIS chart Danube", |
39 WATERWAYAREA: "Waterway Area", | 39 WATERWAYAREA: "Waterway Area", |
371 let bnCenter = getCenter(feature.getGeometry().getExtent()); | 371 let bnCenter = getCenter(feature.getGeometry().getExtent()); |
372 styles.push( | 372 styles.push( |
373 new Style({ | 373 new Style({ |
374 geometry: new Point(bnCenter), | 374 geometry: new Point(bnCenter), |
375 image: new Icon({ | 375 image: new Icon({ |
376 src: require("../assets/marker-bottleneck-critical.png"), | 376 src: require("@/assets/marker-bottleneck-critical.png"), |
377 anchor: [0.5, 0.5], | 377 anchor: [0.5, 0.5], |
378 scale: isLegend ? 0.5 : 1 | 378 scale: isLegend ? 0.5 : 1 |
379 }) | 379 }) |
380 }) | 380 }) |
381 ); | 381 ); |
450 }), | 450 }), |
451 style: function(feature, resolution, isLegend) { | 451 style: function(feature, resolution, isLegend) { |
452 return [ | 452 return [ |
453 new Style({ | 453 new Style({ |
454 image: new Icon({ | 454 image: new Icon({ |
455 src: require("../assets/marker-gauge.png"), | 455 src: require("@/assets/marker-gauge.png"), |
456 anchor: [0.5, isLegend ? 0.5 : 1], | 456 anchor: [0.5, isLegend ? 0.5 : 1], |
457 scale: isLegend ? 0.5 : 1 | 457 scale: isLegend ? 0.5 : 1 |
458 }), | 458 }), |
459 text: new Text({ | 459 text: new Text({ |
460 font: '10px "Open Sans", "sans-serif"', | 460 font: '10px "Open Sans", "sans-serif"', |
509 styles.push( | 509 styles.push( |
510 new Style({ | 510 new Style({ |
511 geometry: new Point(end), | 511 geometry: new Point(end), |
512 image: new Icon({ | 512 image: new Icon({ |
513 // we need to make sure the image is loaded by Vue Loader | 513 // we need to make sure the image is loaded by Vue Loader |
514 src: require("../assets/linestring_arrow.png"), | 514 src: require("@/assets/linestring_arrow.png"), |
515 // fiddling with the anchor's y value does not help to | 515 // fiddling with the anchor's y value does not help to |
516 // position the image more centered on the line ending, as the | 516 // position the image more centered on the line ending, as the |
517 // default line style seems to be slightly uncentered in the | 517 // default line style seems to be slightly uncentered in the |
518 // anti-aliasing, but the image is not placed with subpixel | 518 // anti-aliasing, but the image is not placed with subpixel |
519 // precision | 519 // precision |
557 styles.push( | 557 styles.push( |
558 new Style({ | 558 new Style({ |
559 geometry: new Point(end), | 559 geometry: new Point(end), |
560 image: new Icon({ | 560 image: new Icon({ |
561 // we need to make sure the image is loaded by Vue Loader | 561 // we need to make sure the image is loaded by Vue Loader |
562 src: require("../assets/linestring_arrow_grey.png"), | 562 src: require("@/assets/linestring_arrow_grey.png"), |
563 // fiddling with the anchor's y value does not help to | 563 // fiddling with the anchor's y value does not help to |
564 // position the image more centered on the line ending, as the | 564 // position the image more centered on the line ending, as the |
565 // default line style seems to be slightly uncentered in the | 565 // default line style seems to be slightly uncentered in the |
566 // anti-aliasing, but the image is not placed with subpixel | 566 // anti-aliasing, but the image is not placed with subpixel |
567 // precision | 567 // precision |