-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: Remove `Style` component, use `styleJSON` of `MapView` instead
- Loading branch information
1 parent
a7c3294
commit d232e54
Showing
10 changed files
with
35 additions
and
734 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { MapView } from "@maplibre/maplibre-react-native"; | ||
import { useState } from "react"; | ||
import { Text } from "react-native"; | ||
|
||
import MapLibreDemoTilesBlue from "../../assets/styles/maplibre-demo-tiles-blue.json"; | ||
import MapLibreDemoTilesWhite from "../../assets/styles/maplibre-demo-tiles-white.json"; | ||
import Bubble from "../../components/Bubble"; | ||
import { sheet } from "../../styles/sheet"; | ||
|
||
const STYLE_BLUE = JSON.stringify(MapLibreDemoTilesBlue); | ||
const STYLE_WHITE = JSON.stringify(MapLibreDemoTilesWhite); | ||
|
||
export default function LocalStyleJSON() { | ||
const [color, setColor] = useState<"blue" | "white">("blue"); | ||
|
||
return ( | ||
<> | ||
<MapView | ||
style={sheet.matchParent} | ||
styleJSON={{ blue: STYLE_BLUE, white: STYLE_WHITE }[color]} | ||
/> | ||
<Bubble | ||
onPress={() => | ||
setColor((prevState) => { | ||
return ({ blue: "white", white: "blue" } as const)[prevState]; | ||
}) | ||
} | ||
> | ||
<Text>Switch Style JSON</Text> | ||
</Bubble> | ||
</> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.