Skip to content

Commit

Permalink
clean up and remove urls
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanschaller committed Aug 9, 2023
1 parent 48a41d5 commit b79f945
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ class MapLibreLocalization(private val mapBoxMap: MapboxMap) {
for (layer in symbolLayers) {
val expression = layer.textField.expression ?: continue

val languageNameRegex = Regex("(name:[a-z][a-z])")
val nameRegex = Regex("(name:[a-z]+)")

val newExpression = expression
.toString()
.replace(languageNameRegex, "name:$language")
.replace(nameRegex, "name:$language")

layer.setProperties(PropertyFactory.textField(Expression.raw(newExpression)))
}
Expand Down
1 change: 0 additions & 1 deletion example/lib/full_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class FullMapState extends State<FullMap> {
// ),
// ),
body: MaplibreMap(
styleString: "https://api.maptiler.com/maps/3dd4d51b-ae78-4074-8b31-b47a49f1b5ce/style.json?key=kZ5xAKKbPzxo3GeJ2odT",
// TODO: styleString: isLight ? MapboxStyles.LIGHT : MapboxStyles.DARK,
onMapCreated: _onMapCreated,
initialCameraPosition: const CameraPosition(target: LatLng(0.0, 0.0)),
Expand Down
2 changes: 0 additions & 2 deletions example/lib/localized_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ class LocalizedMapState extends State<LocalizedMap> {
),
Expanded(
child: MaplibreMap(
styleString:
"https://api.maptiler.com/maps/3dd4d51b-ae78-4074-8b31-b47a49f1b5ce/style.json?key=kZ5xAKKbPzxo3GeJ2odT",
onMapCreated: _onMapCreated,
initialCameraPosition:
const CameraPosition(target: LatLng(0.0, 0.0)),
Expand Down

0 comments on commit b79f945

Please sign in to comment.