@@ -253,8 +253,8 @@ export function resolveVersionConflicts(mapVersion) {
253253 const source = findCell ( s . x , s . y ) ;
254254 const mouth = findCell ( e . x , e . y ) ;
255255 const name = Rivers . getName ( mouth ) ;
256- const type = length < 25 ? rw ( { Creek : 9 , River : 3 , Brook : 3 , Stream : 1 } ) : "River" ;
257- pack . rivers . push ( { i, parent : 0 , length, source, mouth, basin : i , name, type } ) ;
256+ const type = length < 25 ? rw ( { Creek : 9 , River : 3 , Brook : 3 , Stream : 1 } ) : "River" ;
257+ pack . rivers . push ( { i, parent : 0 , length, source, mouth, basin : i , name, type} ) ;
258258 } ) ;
259259 }
260260
@@ -270,7 +270,7 @@ export function resolveVersionConflicts(mapVersion) {
270270 const era = Names . getBaseShort ( P ( 0.7 ) ? 1 : rand ( nameBases . length ) ) + " Era" ;
271271 const eraShort = era [ 0 ] + "E" ;
272272 const military = Military . getDefaultOptions ( ) ;
273- options = { winds, year, era, eraShort, military } ;
273+ options = { winds, year, era, eraShort, military} ;
274274
275275 // v1.3 added campaings data for all states
276276 States . generateCampaigns ( ) ;
@@ -481,7 +481,7 @@ export function resolveVersionConflicts(mapVersion) {
481481 if ( isOlderThan ( "1.65.0" ) ) {
482482 // v1.65 changed rivers data
483483 d3 . select ( "#rivers" ) . attr ( "style" , null ) ; // remove style to unhide layer
484- const { cells, rivers } = pack ;
484+ const { cells, rivers} = pack ;
485485 const defaultWidthFactor = rn ( 1 / ( pointsInput . dataset . cells / 10000 ) ** 0.25 , 2 ) ;
486486
487487 for ( const river of rivers ) {
@@ -497,8 +497,8 @@ export function resolveVersionConflicts(mapVersion) {
497497
498498 for ( let i = 0 ; i <= segments ; i ++ ) {
499499 const shift = increment * i ;
500- const { x : x1 , y : y1 } = node . getPointAtLength ( length + shift ) ;
501- const { x : x2 , y : y2 } = node . getPointAtLength ( length - shift ) ;
500+ const { x : x1 , y : y1 } = node . getPointAtLength ( length + shift ) ;
501+ const { x : x2 , y : y2 } = node . getPointAtLength ( length - shift ) ;
502502 const x = rn ( ( x1 + x2 ) / 2 , 1 ) ;
503503 const y = rn ( ( y1 + y2 ) / 2 , 1 ) ;
504504
@@ -565,7 +565,7 @@ export function resolveVersionConflicts(mapVersion) {
565565 const fill = circle && circle . getAttribute ( "fill" ) ;
566566 const stroke = circle && circle . getAttribute ( "stroke" ) ;
567567
568- const marker = { i, icon, type, x, y, size, cell } ;
568+ const marker = { i, icon, type, x, y, size, cell} ;
569569 if ( size && size !== 30 ) marker . size = size ;
570570 if ( ! isNaN ( px ) && px !== 12 ) marker . px = px ;
571571 if ( ! isNaN ( dx ) && dx !== 50 ) marker . dx = dx ;
@@ -631,21 +631,21 @@ export function resolveVersionConflicts(mapVersion) {
631631
632632 if ( isOlderThan ( "1.88.0" ) ) {
633633 // v1.87 may have incorrect shield for some reason
634- pack . states . forEach ( ( { coa } ) => {
634+ pack . states . forEach ( ( { coa} ) => {
635635 if ( coa ?. shield === "state" ) delete coa . shield ;
636636 } ) ;
637637 }
638638
639639 if ( isOlderThan ( "1.91.0" ) ) {
640640 // from 1.91.00 custom coa is moved to coa object
641641 pack . states . forEach ( state => {
642- if ( state . coa === "custom" ) state . coa = { custom : true } ;
642+ if ( state . coa === "custom" ) state . coa = { custom : true } ;
643643 } ) ;
644644 pack . provinces . forEach ( province => {
645- if ( province . coa === "custom" ) province . coa = { custom : true } ;
645+ if ( province . coa === "custom" ) province . coa = { custom : true } ;
646646 } ) ;
647647 pack . burgs . forEach ( burg => {
648- if ( burg . coa === "custom" ) burg . coa = { custom : true } ;
648+ if ( burg . coa === "custom" ) burg . coa = { custom : true } ;
649649 } ) ;
650650
651651 // from 1.91.00 emblems don't have transform attribute
@@ -747,7 +747,7 @@ export function resolveVersionConflicts(mapVersion) {
747747 const skip = terrs . attr ( "skip" ) ;
748748 const relax = terrs . attr ( "relax" ) ;
749749
750- const curveTypes = { 0 : "curveBasisClosed" , 1 : "curveLinear" , 2 : "curveStep" } ;
750+ const curveTypes = { 0 : "curveBasisClosed" , 1 : "curveLinear" , 2 : "curveStep" } ;
751751 const curve = curveTypes [ terrs . attr ( "curve" ) ] || "curveBasisClosed" ;
752752
753753 terrs
@@ -882,7 +882,7 @@ export function resolveVersionConflicts(mapVersion) {
882882 const secondCellId = points [ 1 ] [ 2 ] ;
883883 const feature = pack . cells . f [ secondCellId ] ;
884884
885- pack . routes . push ( { i : pack . routes . length , group, feature, points } ) ;
885+ pack . routes . push ( { i : pack . routes . length , group, feature, points} ) ;
886886 }
887887 }
888888 routes . selectAll ( "path" ) . remove ( ) ;
@@ -914,7 +914,7 @@ export function resolveVersionConflicts(mapVersion) {
914914 const type = this . dataset . type ;
915915 const color = this . getAttribute ( "fill" ) ;
916916 const cells = this . dataset . cells . split ( "," ) . map ( Number ) ;
917- pack . zones . push ( { i, name, type, cells, color } ) ;
917+ pack . zones . push ( { i, name, type, cells, color} ) ;
918918 } ) ;
919919 zones . style ( "display" , null ) . selectAll ( "*" ) . remove ( ) ;
920920 if ( layerIsOn ( "toggleZones" ) ) drawZones ( ) ;
@@ -975,7 +975,7 @@ export function resolveVersionConflicts(mapVersion) {
975975
976976 if ( isOlderThan ( "1.109.0" ) ) {
977977 // v1.109.0 added customizable burg groups and icons
978- options . burgs = { groups : [ ] } ;
978+ options . burgs = { groups : [ ] } ;
979979
980980 burgIcons . selectAll ( "circle, use" ) . each ( function ( ) {
981981 const group = this . parentNode . id ;
@@ -987,7 +987,7 @@ export function resolveVersionConflicts(mapVersion) {
987987 burgIcons . selectAll ( "g" ) . each ( function ( _el , index ) {
988988 const name = this . id ;
989989 const isDefault = name === "towns" ;
990- options . burgs . groups . push ( { name, active : true , order : index + 1 , isDefault, preview : "watabou-city" } ) ;
990+ options . burgs . groups . push ( { name, active : true , order : index + 1 , isDefault, preview : "watabou-city" } ) ;
991991 if ( ! this . dataset . icon ) this . dataset . icon = "#icon-circle" ;
992992
993993 const size = Number ( this . getAttribute ( "size" ) || 2 ) * 2 ;
@@ -1036,74 +1036,4 @@ export function resolveVersionConflicts(mapVersion) {
10361036 delete options . showMFCGMap ;
10371037 delete options . villageMaxPopulation ;
10381038 }
1039-
1040- if ( isOlderThan ( "1.111.0" ) ) {
1041- // v1.111.0 moved ice data from SVG to data model
1042- // Migrate old ice SVG elements to new pack.ice structure
1043- if ( ! pack . ice ) {
1044- pack . ice = [ ] ;
1045- let iceId = 0 ;
1046-
1047- const iceLayer = document . getElementById ( "ice" ) ;
1048- if ( iceLayer ) {
1049- // Migrate glaciers (type="iceShield")
1050- iceLayer . querySelectorAll ( "polygon[type='iceShield']" ) . forEach ( polygon => {
1051- // Parse points string "x1,y1 x2,y2 x3,y3 ..." into array [[x1,y1], [x2,y2], ...]
1052- const points = [ ...polygon . points ] . map ( svgPoint => [ svgPoint . x , svgPoint . y ] ) ;
1053-
1054- const transform = polygon . getAttribute ( "transform" ) ;
1055- const iceElement = {
1056- i : iceId ++ ,
1057- points,
1058- type : "glacier"
1059- } ;
1060- if ( transform ) {
1061- iceElement . offset = parseTransform ( transform ) ;
1062- }
1063- pack . ice . push ( iceElement ) ;
1064- } ) ;
1065-
1066- // Migrate icebergs
1067- iceLayer . querySelectorAll ( "polygon:not([type])" ) . forEach ( polygon => {
1068- const cellId = + polygon . getAttribute ( "cell" ) ;
1069- const size = + polygon . getAttribute ( "size" ) ;
1070-
1071- // points string must exist, cell attribute must be present, and size must be non-zero
1072- if ( polygon . getAttribute ( "cell" ) === null || ! size ) return ;
1073-
1074- // Parse points string "x1,y1 x2,y2 x3,y3 ..." into array [[x1,y1], [x2,y2], ...]
1075- const points = [ ...polygon . points ] . map ( svgPoint => [ svgPoint . x , svgPoint . y ] ) ;
1076-
1077- const transform = polygon . getAttribute ( "transform" ) ;
1078- const iceElement = {
1079- i : iceId ++ ,
1080- points,
1081- type : "iceberg" ,
1082- cellId,
1083- size
1084- } ;
1085- if ( transform ) {
1086- iceElement . offset = parseTransform ( transform ) ;
1087- }
1088- pack . ice . push ( iceElement ) ;
1089- } ) ;
1090-
1091- // Clear old SVG elements
1092- iceLayer . querySelectorAll ( "*" ) . forEach ( el => el . remove ( ) ) ;
1093- } else {
1094- // If ice layer element doesn't exist, create it
1095- ice = viewbox . insert ( "g" , "#coastline" ) . attr ( "id" , "ice" ) ;
1096- ice
1097- . attr ( "opacity" , null )
1098- . attr ( "fill" , "#e8f0f6" )
1099- . attr ( "stroke" , "#e8f0f6" )
1100- . attr ( "stroke-width" , 1 )
1101- . attr ( "filter" , "url(#dropShadow05)" ) ;
1102- }
1103-
1104- // Re-render ice from migrated data
1105- if ( layerIsOn ( "toggleIce" ) ) drawIce ( ) ;
1106- }
1107-
1108- }
11091039}
0 commit comments