File tree Expand file tree Collapse file tree
Modularity/source/php/Module/InteractiveMap/assets/map Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,12 +6,10 @@ import {
66import { SavedImageOverlay , SavedLayerGroup , SavedMarker } from "../mapData" ;
77import { LayerGroupFilterInterface } from "./filtering/layerGroupFilterInterface" ;
88
9- type MarkersData = {
10- [ key : string ] : {
11- data : SavedMarker ;
12- marker : MarkerInterface ;
13- } ;
14- } ;
9+ type MarkersData = Array < {
10+ data : SavedMarker ;
11+ marker : MarkerInterface ;
12+ } > ;
1513
1614type LayerGroupData = {
1715 data : SavedLayerGroup ;
Original file line number Diff line number Diff line change @@ -13,13 +13,12 @@ class Markers {
1313 ) { }
1414
1515 public createMarkers ( ) : MarkersData {
16- let markers : MarkersData = { } ;
16+ let markers : MarkersData = [ ] ;
1717 this . savedMarkers . forEach ( ( markerData ) => {
1818 const hasParent = this . hasParent ( markerData . layerGroup ) ;
1919 const markerColor = this . getMarkerColor ( hasParent , markerData . layerGroup ) ;
2020 const markerIcon = this . getMarkerIcon ( hasParent , markerData . layerGroup ) ;
2121 const html = this . getHtml ( markerIcon , markerColor ) ;
22- let highlighted = false ;
2322
2423 const marker = new CreateMarker ( ) . create (
2524 {
@@ -55,7 +54,6 @@ class Markers {
5554 } ) ;
5655
5756 marker . addListener ( "popupopen" , ( ) => {
58- highlighted = true ;
5957 marker . setIcon ( {
6058 html : this . getHighlightedHtml ( markerIcon , markerColor ) ,
6159 iconSize : [ 32 , 32 ] ,
@@ -64,13 +62,17 @@ class Markers {
6462 } ) ;
6563
6664 marker . addListener ( "popupclose" , ( ) => {
67- highlighted = true ;
6865 marker . setIcon ( {
6966 html : this . getHtml ( markerIcon , markerColor ) ,
7067 iconSize : [ 32 , 32 ] ,
7168 iconAnchor : [ 16 , 2 ] ,
7269 } ) ;
7370 } ) ;
71+
72+ markers . push ( {
73+ data : markerData ,
74+ marker,
75+ } ) ;
7476 } ) ;
7577
7678 return markers ;
You can’t perform that action at this time.
0 commit comments