File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 401401 a . id = 'rp' + a . ref
402402 if ( ! circles [ a . id ] )
403403 {
404+ a . lat = fix_latlon ( a )
404405 let color = a . opening_hours == 'closed' ? colors . rp_closed : colors . rp
405406 circles [ a . id ] = L . circleMarker ( a , { radius : 3 , color, weight : 1 } )
406407 . bindPopup ( '' , { data : a } ) . addTo ( map )
418419 $ ( 'info' , msg )
419420}
420421
422+ /** не ставим точки в одно и то же место */
423+ function fix_latlon ( a )
424+ {
425+ if ( ! a . lat ) return a . lat
426+
427+ var lat = parseFloat ( a . lat ) , hash = _ => lat + '' + a . lon
428+ if ( ! window . latlon ) window . latlon = { }
429+ let aa = 1
430+ while ( window . latlon [ hash ( ) ] )
431+ {
432+ lat -= 0.5 / 10000
433+ if ( aa ++ > 10 ) break ;
434+ }
435+ window . latlon [ hash ( ) ] = 1
436+ return lat
437+ }
438+
421439var g_moveInterval = 0
422440map . on ( 'moveend' , _ => {
423441 clearInterval ( g_moveInterval )
You can’t perform that action at this time.
0 commit comments