Skip to content

Commit aa37a15

Browse files
Basemap styles cleanup (#95)
* Basemap styles cleanup * Basemap styles cleanup * fix a crash where no active referenceLayer was active during base map style switch * add switch style button --------- Co-authored-by: Julian Bissekkou <[email protected]>
1 parent c82c3a2 commit aa37a15

File tree

11 files changed

+554
-145
lines changed

11 files changed

+554
-145
lines changed

arcgis_map_sdk_android/android/src/main/kotlin/dev/fluttercommunity/arcgis_map_sdk_android/Parsing.kt

Lines changed: 67 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -178,56 +178,68 @@ fun parseAnimationCurve(value: String): AnimationCurve {
178178
}
179179
}
180180

181-
fun BasemapStyle.getJsonValue(): String? {
181+
fun BasemapStyle.getJsonValue(): String {
182182
return when (this) {
183183
BasemapStyle.ArcGISImagery -> "arcgisImagery"
184184
BasemapStyle.ArcGISImageryStandard -> "arcgisImageryStandard"
185185
BasemapStyle.ArcGISImageryLabels -> "arcgisImageryLabels"
186186
BasemapStyle.ArcGISLightGray -> "arcgisLightGray"
187-
BasemapStyle.ArcGISLightGray -> null
188-
BasemapStyle.ArcGISLightGrayLabels -> null
187+
BasemapStyle.ArcGISLightGrayBase -> "arcgisLightGrayBase"
188+
BasemapStyle.ArcGISLightGrayLabels -> "arcgisLightGrayLabels"
189189
BasemapStyle.ArcGISDarkGray -> "arcgisDarkGray"
190-
BasemapStyle.ArcGISDarkGrayBase -> null
191-
BasemapStyle.ArcGISDarkGrayLabels -> null
190+
BasemapStyle.ArcGISDarkGrayBase -> "arcgisDarkGrayBase"
191+
BasemapStyle.ArcGISDarkGrayLabels -> "arcgisDarkGrayLabels"
192192
BasemapStyle.ArcGISNavigation -> "arcgisNavigation"
193193
BasemapStyle.ArcGISNavigationNight -> "arcgisNavigationNight"
194194
BasemapStyle.ArcGISStreets -> "arcgisStreets"
195+
BasemapStyle.ArcGISStreetsRelief -> "arcgisStreetsRelief"
196+
BasemapStyle.ArcGISStreetsReliefBase -> "arcgisStreetsReliefBase"
195197
BasemapStyle.ArcGISStreetsNight -> "arcgisStreetsNight"
196-
BasemapStyle.OsmStreetsRelief -> "arcgisStreetsRelief"
197198
BasemapStyle.ArcGISTopographic -> "arcgisTopographic"
199+
BasemapStyle.ArcGISTopographicBase -> "arcgisTopographicBase"
198200
BasemapStyle.ArcGISOceans -> "arcgisOceans"
199-
BasemapStyle.ArcGISOceansBase -> null
200-
BasemapStyle.ArcGISOceansLabels -> null
201+
BasemapStyle.ArcGISOceansBase -> "arcgisOceansBase"
202+
BasemapStyle.ArcGISOceansLabels -> "arcgisOceansLabels"
201203
BasemapStyle.ArcGISTerrain -> "arcgisTerrain"
202-
BasemapStyle.ArcGISTerrainBase -> null
203-
BasemapStyle.ArcGISTerrainDetail -> null
204+
BasemapStyle.ArcGISTerrainBase -> "arcgisTerrainBase"
205+
BasemapStyle.ArcGISTerrainDetail -> "arcgisTerrainDetail"
204206
BasemapStyle.ArcGISCommunity -> "arcgisCommunity"
205207
BasemapStyle.ArcGISChartedTerritory -> "arcgisChartedTerritory"
208+
BasemapStyle.ArcGISChartedTerritoryBase -> "arcgisChartedTerritoryBase"
206209
BasemapStyle.ArcGISColoredPencil -> "arcgisColoredPencil"
207210
BasemapStyle.ArcGISNova -> "arcgisNova"
208211
BasemapStyle.ArcGISModernAntique -> "arcgisModernAntique"
212+
BasemapStyle.ArcGISModernAntiqueBase -> "arcgisModernAntiqueBase"
209213
BasemapStyle.ArcGISMidcentury -> "arcgisMidcentury"
210214
BasemapStyle.ArcGISNewspaper -> "arcgisNewspaper"
211215
BasemapStyle.ArcGISHillshadeLight -> "arcgisHillshadeLight"
212216
BasemapStyle.ArcGISHillshadeDark -> "arcgisHillshadeDark"
213-
BasemapStyle.ArcGISStreetsReliefBase -> null
214-
BasemapStyle.ArcGISTopographicBase -> null
215-
BasemapStyle.ArcGISChartedTerritoryBase -> null
216-
BasemapStyle.ArcGISModernAntiqueBase -> null
217+
BasemapStyle.ArcGISOutdoor -> "arcgisOutdoor"
218+
BasemapStyle.ArcGISHumanGeography -> "arcgisHumanGeography"
219+
BasemapStyle.ArcGISHumanGeographyBase -> "arcgisHumanGeographyBase"
220+
BasemapStyle.ArcGISHumanGeographyDetail -> "arcgisHumanGeographyDetail"
221+
BasemapStyle.ArcGISHumanGeographyLabels -> "arcgisHumanGeographyLabels"
222+
BasemapStyle.ArcGISHumanGeographyDark -> "arcgisHumanGeographyDark"
223+
BasemapStyle.ArcGISHumanGeographyDarkBase -> "arcgisHumanGeographyDarkBase"
224+
BasemapStyle.ArcGISHumanGeographyDarkDetail -> "arcgisHumanGeographyDarkDetail"
225+
BasemapStyle.ArcGISHumanGeographyDarkLabels -> "arcgisHumanGeographyDarkLabels"
217226
BasemapStyle.OsmStandard -> "osmStandard"
218227
BasemapStyle.OsmStandardRelief -> "osmStandardRelief"
219-
BasemapStyle.OsmStandardReliefBase -> null
228+
BasemapStyle.OsmStandardReliefBase -> "osmStandardReliefBase"
220229
BasemapStyle.OsmStreets -> "osmStreets"
221230
BasemapStyle.OsmStreetsRelief -> "osmStreetsRelief"
222-
BasemapStyle.OsmStreetsReliefBase -> null
231+
BasemapStyle.OsmStreetsReliefBase -> "osmStreetsReliefBase"
223232
BasemapStyle.OsmLightGray -> "osmLightGray"
224-
BasemapStyle.OsmLightGrayBase -> null
225-
BasemapStyle.OsmLightGrayLabels -> null
233+
BasemapStyle.OsmLightGrayBase -> "osmLightGrayBase"
234+
BasemapStyle.OsmLightGrayLabels -> "osmLightGrayLabels"
226235
BasemapStyle.OsmDarkGray -> "osmDarkGray"
227-
BasemapStyle.OsmDarkGrayBase -> null
228-
BasemapStyle.OsmDarkGrayLabels -> null
229-
BasemapStyle.OsmHybrid -> "hybrid"
230-
else -> null
236+
BasemapStyle.OsmDarkGrayBase -> "osmDarkGrayBase"
237+
BasemapStyle.OsmDarkGrayLabels -> "osmDarkGrayLabels"
238+
BasemapStyle.OsmBlueprint -> "osmBlueprint"
239+
BasemapStyle.OsmHybrid -> "osmHybrid"
240+
BasemapStyle.OsmHybridDetail -> "osmHybridDetail"
241+
BasemapStyle.OsmNavigation -> "osmNavigation"
242+
BasemapStyle.OsmNavigationDark -> "osmNavigationDark"
231243
}
232244
}
233245

@@ -237,31 +249,62 @@ fun parseBasemapStyle(value: String): BasemapStyle? {
237249
"arcgisImageryStandard" -> BasemapStyle.ArcGISImageryStandard
238250
"arcgisImageryLabels" -> BasemapStyle.ArcGISImageryLabels
239251
"arcgisLightGray" -> BasemapStyle.ArcGISLightGray
252+
"arcgisLightGrayBase" -> BasemapStyle.ArcGISLightGrayBase
253+
"arcgisLightGrayLabels" -> BasemapStyle.ArcGISLightGrayLabels
240254
"arcgisDarkGray" -> BasemapStyle.ArcGISDarkGray
255+
"arcgisDarkGrayBase" -> BasemapStyle.ArcGISDarkGrayBase
256+
"arcgisDarkGrayLabels" -> BasemapStyle.ArcGISDarkGrayLabels
241257
"arcgisNavigation" -> BasemapStyle.ArcGISNavigation
242258
"arcgisNavigationNight" -> BasemapStyle.ArcGISNavigationNight
243259
"arcgisStreets" -> BasemapStyle.ArcGISStreets
260+
"arcgisStreetsRelief" -> BasemapStyle.ArcGISStreetsRelief
261+
"arcgisStreetsReliefBase" -> BasemapStyle.ArcGISStreetsReliefBase
244262
"arcgisStreetsNight" -> BasemapStyle.ArcGISStreetsNight
245-
"arcgisStreetsRelief" -> BasemapStyle.OsmStreetsRelief
246263
"arcgisTopographic" -> BasemapStyle.ArcGISTopographic
264+
"arcgisTopographicBase" -> BasemapStyle.ArcGISTopographicBase
247265
"arcgisOceans" -> BasemapStyle.ArcGISOceans
266+
"arcgisOceansBase" -> BasemapStyle.ArcGISOceansBase
267+
"arcgisOceansLabels" -> BasemapStyle.ArcGISOceansLabels
248268
"arcgisTerrain" -> BasemapStyle.ArcGISTerrain
269+
"arcgisTerrainBase" -> BasemapStyle.ArcGISTerrainBase
270+
"arcgisTerrainDetail" -> BasemapStyle.ArcGISTerrainDetail
249271
"arcgisCommunity" -> BasemapStyle.ArcGISCommunity
250272
"arcgisChartedTerritory" -> BasemapStyle.ArcGISChartedTerritory
273+
"arcgisChartedTerritoryBase" -> BasemapStyle.ArcGISChartedTerritoryBase
251274
"arcgisColoredPencil" -> BasemapStyle.ArcGISColoredPencil
252275
"arcgisNova" -> BasemapStyle.ArcGISNova
253276
"arcgisModernAntique" -> BasemapStyle.ArcGISModernAntique
277+
"arcgisModernAntiqueBase" -> BasemapStyle.ArcGISModernAntiqueBase
254278
"arcgisMidcentury" -> BasemapStyle.ArcGISMidcentury
255279
"arcgisNewspaper" -> BasemapStyle.ArcGISNewspaper
256280
"arcgisHillshadeLight" -> BasemapStyle.ArcGISHillshadeLight
257281
"arcgisHillshadeDark" -> BasemapStyle.ArcGISHillshadeDark
282+
"arcgisOutdoor" -> BasemapStyle.ArcGISOutdoor
283+
"arcgisHumanGeography" -> BasemapStyle.ArcGISHumanGeography
284+
"arcgisHumanGeographyBase" -> BasemapStyle.ArcGISHumanGeographyBase
285+
"arcgisHumanGeographyDetail" -> BasemapStyle.ArcGISHumanGeographyDetail
286+
"arcgisHumanGeographyLabels" -> BasemapStyle.ArcGISHumanGeographyLabels
287+
"arcgisHumanGeographyDark" -> BasemapStyle.ArcGISHumanGeographyDark
288+
"arcgisHumanGeographyDarkBase" -> BasemapStyle.ArcGISHumanGeographyDarkBase
289+
"arcgisHumanGeographyDarkDetail" -> BasemapStyle.ArcGISHumanGeographyDarkDetail
290+
"arcgisHumanGeographyDarkLabels" -> BasemapStyle.ArcGISHumanGeographyDarkLabels
258291
"osmStandard" -> BasemapStyle.OsmStandard
259292
"osmStandardRelief" -> BasemapStyle.OsmStandardRelief
293+
"osmStandardReliefBase" -> BasemapStyle.OsmStandardReliefBase
260294
"osmStreets" -> BasemapStyle.OsmStreets
261295
"osmStreetsRelief" -> BasemapStyle.OsmStreetsRelief
296+
"osmStreetsReliefBase" -> BasemapStyle.OsmStreetsReliefBase
262297
"osmLightGray" -> BasemapStyle.OsmLightGray
298+
"osmLightGrayBase" -> BasemapStyle.OsmLightGrayBase
299+
"osmLightGrayLabels" -> BasemapStyle.OsmLightGrayLabels
263300
"osmDarkGray" -> BasemapStyle.OsmDarkGray
264-
"hybrid" -> BasemapStyle.OsmHybrid
301+
"osmDarkGrayBase" -> BasemapStyle.OsmDarkGrayBase
302+
"osmDarkGrayLabels" -> BasemapStyle.OsmDarkGrayLabels
303+
"osmBlueprint" -> BasemapStyle.OsmBlueprint
304+
"osmHybrid" -> BasemapStyle.OsmHybrid
305+
"osmHybridDetail" -> BasemapStyle.OsmHybridDetail
306+
"osmNavigation" -> BasemapStyle.OsmNavigation
307+
"osmNavigationDark" -> BasemapStyle.OsmNavigationDark
265308
else -> null
266309
}
267310
}

arcgis_map_sdk_ios/ios/arcgis_map_sdk_ios/Sources/arcgis_map_sdk_ios/ArcgisMapView.swift

Lines changed: 73 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,9 @@ extension Basemap.Style: CaseIterable {
615615
.arcGISStreets,
616616
.arcGISStreetsNight,
617617
.arcGISStreetsRelief,
618+
.arcGISStreetsReliefBase,
618619
.arcGISTopographic,
620+
.arcGISTopographicBase,
619621
.arcGISOceans,
620622
.arcGISOceansBase,
621623
.arcGISOceansLabels,
@@ -624,29 +626,41 @@ extension Basemap.Style: CaseIterable {
624626
.arcGISTerrainDetail,
625627
.arcGISCommunity,
626628
.arcGISChartedTerritory,
629+
.arcGISChartedTerritoryBase,
627630
.arcGISColoredPencil,
628631
.arcGISNova,
629632
.arcGISModernAntique,
633+
.arcGISModernAntiqueBase,
630634
.arcGISMidcentury,
631635
.arcGISNewspaper,
632636
.arcGISHillshadeLight,
633637
.arcGISHillshadeDark,
634-
.arcGISStreetsReliefBase,
635-
.arcGISTopographicBase,
636-
.arcGISChartedTerritoryBase,
637-
.arcGISModernAntiqueBase,
638+
.arcGISOutdoor,
639+
.arcGISHumanGeography,
640+
.arcGISHumanGeographyBase,
641+
.arcGISHumanGeographyDetail,
642+
.arcGISHumanGeographyLabels,
643+
.arcGISHumanGeographyDark,
644+
.arcGISHumanGeographyDarkBase,
645+
.arcGISHumanGeographyDarkDetail,
646+
.arcGISHumanGeographyDarkLabels,
638647
.osmStandard,
639648
.osmStandardRelief,
640649
.osmStandardReliefBase,
641650
.osmStreets,
642651
.osmStreetsRelief,
652+
.osmStreetsReliefBase,
643653
.osmLightGray,
644654
.osmLightGrayBase,
645655
.osmLightGrayLabels,
646656
.osmDarkGray,
647657
.osmDarkGrayBase,
648658
.osmDarkGrayLabels,
649-
.osmStreetsReliefBase
659+
.osmBlueprint,
660+
.osmHybrid,
661+
.osmHybridDetail,
662+
.osmNavigation,
663+
.osmNavigationDark,
650664
]
651665
}
652666
}
@@ -663,49 +677,57 @@ extension Basemap.Style {
663677
case .arcGISLightGray:
664678
return "arcgisLightGray"
665679
case .arcGISLightGrayBase:
666-
return "arcgisDarkGray"
680+
return "arcgisLightGrayBase"
667681
case .arcGISLightGrayLabels:
668-
return nil
682+
return "arcgisLightGrayLabels"
669683
case .arcGISDarkGray:
670-
return nil
684+
return "arcgisDarkGray"
671685
case .arcGISDarkGrayBase:
672-
return nil
686+
return "arcgisDarkGrayBase"
673687
case .arcGISDarkGrayLabels:
674-
return nil
688+
return "arcgisDarkGrayLabels"
675689
case .arcGISNavigation:
676690
return "arcgisNavigation"
677691
case .arcGISNavigationNight:
678692
return "arcgisNavigationNight"
679693
case .arcGISStreets:
680694
return "arcgisStreets"
681-
case .arcGISStreetsNight:
682-
return "arcgisStreetsNight"
683695
case .arcGISStreetsRelief:
684696
return "arcgisStreetsRelief"
697+
case .arcGISStreetsReliefBase:
698+
return "arcgisStreetsReliefBase"
699+
case .arcGISStreetsNight:
700+
return "arcgisStreetsNight"
685701
case .arcGISTopographic:
686702
return "arcgisTopographic"
703+
case .arcGISTopographicBase:
704+
return "arcgisTopographicBase"
687705
case .arcGISOceans:
688706
return "arcgisOceans"
689707
case .arcGISOceansBase:
690-
return nil
708+
return "arcgisOceansBase"
691709
case .arcGISOceansLabels:
692-
return nil
710+
return "arcgisOceansLabels"
693711
case .arcGISTerrain:
694712
return "arcgisTerrain"
695713
case .arcGISTerrainBase:
696-
return nil
714+
return "arcgisTerrainBase"
697715
case .arcGISTerrainDetail:
698-
return nil
716+
return "arcgisTerrainDetail"
699717
case .arcGISCommunity:
700718
return "arcgisCommunity"
701719
case .arcGISChartedTerritory:
702720
return "arcgisChartedTerritory"
721+
case .arcGISChartedTerritoryBase:
722+
return "arcgisChartedTerritoryBase"
703723
case .arcGISColoredPencil:
704724
return "arcgisColoredPencil"
705725
case .arcGISNova:
706726
return "arcgisNova"
707727
case .arcGISModernAntique:
708728
return "arcgisModernAntique"
729+
case .arcGISModernAntiqueBase:
730+
return "arcgisModernAntiqueBase"
709731
case .arcGISMidcentury:
710732
return "arcgisMidcentury"
711733
case .arcGISNewspaper:
@@ -714,14 +736,24 @@ extension Basemap.Style {
714736
return "arcgisHillshadeLight"
715737
case .arcGISHillshadeDark:
716738
return "arcgisHillshadeDark"
717-
case .arcGISStreetsReliefBase:
718-
return nil
719-
case .arcGISTopographicBase:
720-
return nil
721-
case .arcGISChartedTerritoryBase:
722-
return nil
723-
case .arcGISModernAntiqueBase:
724-
return nil
739+
case .arcGISOutdoor:
740+
return "arcgisOutdoor"
741+
case .arcGISHumanGeography:
742+
return "arcgisHumanGeography"
743+
case .arcGISHumanGeographyBase:
744+
return "arcgisHumanGeographyBase"
745+
case .arcGISHumanGeographyDetail:
746+
return "arcgisHumanGeographyDetail"
747+
case .arcGISHumanGeographyLabels:
748+
return "arcgisHumanGeographyLabels"
749+
case .arcGISHumanGeographyDark:
750+
return "arcgisHumanGeographyDark"
751+
case .arcGISHumanGeographyDarkBase:
752+
return "arcgisHumanGeographyDarkBase"
753+
case .arcGISHumanGeographyDarkDetail:
754+
return "arcgisHumanGeographyDarkDetail"
755+
case .arcGISHumanGeographyDarkLabels:
756+
return "arcgisHumanGeographyDarkLabels"
725757
case .osmStandard:
726758
return "osmStandard"
727759
case .osmStandardRelief:
@@ -732,22 +764,31 @@ extension Basemap.Style {
732764
return "osmStreets"
733765
case .osmStreetsRelief:
734766
return "osmStreetsRelief"
767+
case .osmStreetsReliefBase:
768+
return "osmStreetsReliefBase"
735769
case .osmLightGray:
736770
return "osmLightGray"
737771
case .osmLightGrayBase:
738-
return nil
772+
return "osmLightGrayBase"
739773
case .osmLightGrayLabels:
740-
return nil
774+
return "osmLightGrayLabels"
741775
case .osmDarkGray:
742776
return "osmDarkGray"
743777
case .osmDarkGrayBase:
744-
return nil
778+
return "osmDarkGrayBase"
745779
case .osmDarkGrayLabels:
746-
return nil
747-
case .osmStreetsReliefBase:
748-
return nil
749-
@unknown default:
750-
return nil
780+
return "osmDarkGrayLabels"
781+
case .osmBlueprint:
782+
return "osmBlueprint"
783+
case .osmHybrid:
784+
return "osmHybrid"
785+
case .osmHybridDetail:
786+
return "osmHybridDetail"
787+
case .osmNavigation:
788+
return "osmNavigation"
789+
case .osmNavigationDark:
790+
return "osmNavigationDark"
791+
751792
}
752793
}
753794
}

arcgis_map_sdk_ios/ios/arcgis_map_sdk_ios/Sources/arcgis_map_sdk_ios/GraphicsParser.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class GraphicsParser {
9898
case "simple-marker":
9999
return parseSimpleMarkerSymbol(dictionary)
100100
case "picture-marker":
101-
return parsePictureMarkerSymbol(dictionary)
101+
return try parsePictureMarkerSymbol(dictionary)
102102
case "simple-fill":
103103
return parseSimpleFillMarkerSymbol(dictionary)
104104
case "simple-line":

0 commit comments

Comments
 (0)