@@ -128,7 +128,8 @@ async function initMap() {
128128function mapDotSVG ( ratio , docks = false ) {
129129 // Calculate the Y coordinate at which the top of the "fill" rectangle will be
130130 // (the filled area is only visible from y=18 to y=430)
131- const y = ( 18 + ( 1 - ratio ) * ( 430 - 18 ) ) . toFixed ( 0 ) ;
131+ const effectiveRatio = docks ? 1 - ratio : ratio ;
132+ const y = ( 18 + ( 1 - effectiveRatio ) * ( 430 - 18 ) ) . toFixed ( 0 ) ;
132133
133134 // Create the SVG itself
134135 const svgString = `
@@ -171,7 +172,7 @@ async function loadStationMarkersFromArray(stationsArray, showDocks = false) {
171172
172173 let featuresArray = [ ] ;
173174
174- for ( const [ featureID , station ] of stationsArray . entries ( ) ) {
175+ for ( const [ featureID , station ] of stationsArray . sort ( ( a , b ) => b . latitude - a . latitude ) . entries ( ) ) {
175176 let position = [ station . longitude , station . latitude ] ;
176177
177178 const iconFeature = new ol . Feature ( {
@@ -268,7 +269,7 @@ async function loadStationMarkersFromArray(stationsArray, showDocks = false) {
268269 className : "stationsLayer" ,
269270 name : "stationsLayer" ,
270271 source : vectorSource ,
271- zIndex : 0 ,
272+ zIndex : 2 ,
272273 //declutter: true
273274 } ) ;
274275
@@ -332,7 +333,7 @@ function getLocation(zoom = true, followLocationOverride) {
332333 const vectorLayer = new ol . layer . Vector ( {
333334 name : "currentLocationLayer" ,
334335 source : vectorSource ,
335- zIndex : 99 ,
336+ zIndex : 1 ,
336337 updateWhileInteracting : true ,
337338 } ) ;
338339
0 commit comments