Skip to content
GitLab
Explore
Sign in
Commits on Source (3)
Implement setting colorScheme.
· 5c8edf72
Zandor Smith
authored
Mar 28, 2022
5c8edf72
Add MapType and ColorScheme enum values.
· 1c664346
Zandor Smith
authored
Mar 28, 2022
1c664346
Version bump. (v0.8.0)
· 2c963bf9
Zandor Smith
authored
Mar 28, 2022
2c963bf9
Hide whitespace changes
Inline
Side-by-side
package.json
View file @
2c963bf9
{
"name"
:
"@zandor300/react-apple-mapkitjs"
,
"version"
:
"0.
7.2
"
,
"version"
:
"0.
8.0
"
,
"description"
:
"A react wrapper for apple mapkit.js"
,
"main"
:
"lib/index.js"
,
"scripts"
:
{
...
...
src/lib/AppleMaps.js
View file @
2c963bf9
...
...
@@ -3,7 +3,7 @@ import TokenManager from "./TokenManager"
class
AppleMaps
extends
Component
{
componentDidMount
()
{
const
{
children
,
initialMapType
,
token
}
=
this
.
props
const
{
children
,
initialMapType
,
token
,
colorScheme
}
=
this
.
props
TokenManager
.
getInstance
().
setToken
(
token
)
...
...
@@ -24,6 +24,9 @@ class AppleMaps extends Component {
if
(
initialMapType
!==
undefined
)
{
this
.
map
.
mapType
=
initialMapType
}
if
(
colorScheme
!==
undefined
)
{
this
.
map
.
colorScheme
=
colorScheme
}
// Annotations
if
(
children
!==
undefined
&&
children
.
length
)
{
...
...
@@ -79,11 +82,16 @@ class AppleMaps extends Component {
zoomLevel
,
width
,
height
,
autoAdjust
autoAdjust
,
colorScheme
}
=
this
.
props
TokenManager
.
getInstance
().
setToken
(
token
)
if
(
colorScheme
!==
prevProps
.
colorScheme
)
{
this
.
map
.
colorScheme
=
colorScheme
}
if
((
prevProps
.
latitude
!==
latitude
||
prevProps
.
longitude
!==
longitude
||
...
...
src/lib/ColorScheme.js
0 → 100644
View file @
2c963bf9
const
Light
=
"
light
"
const
Dark
=
"
dark
"
export
default
{
Light
,
Dark
}
src/lib/MapType.js
0 → 100644
View file @
2c963bf9
const
Standard
=
"
standard
"
const
MutedStandard
=
"
mutedStandard
"
const
Hybrid
=
"
hybrid
"
const
Satellite
=
"
satellite
"
export
default
{
Standard
,
MutedStandard
,
Hybrid
,
Satellite
}
src/lib/index.jsx
View file @
2c963bf9
export
{
default
as
AppleMaps
}
from
'
./AppleMaps
'
export
{
default
as
Annotation
}
from
'
./Annotation
'
export
{
default
as
ImageAnnotation
}
from
'
./ImageAnnotation
'
export
{
default
as
CurrentLocationOverride
}
from
'
./CurrentLocationOverride
'
export
{
default
as
CurrentLocationOverride
}
from
'
./CurrentLocationOverride
'
export
{
default
as
MapType
}
from
'
./MapType
'
;
export
{
default
as
ColorScheme
}
from
'
./ColorScheme
'
;