Skip to content
GitLab
Explore
Sign in
Commits on Source (3)
Allow specifying a custom Coordinate Span instead of zoomlevel.
· f360603d
Zandor Smith
authored
Nov 29, 2021
f360603d
Merge branch 'feature/custom-coordinate-span'
· 72c971d4
Zandor Smith
authored
Nov 29, 2021
72c971d4
Version bump. (v0.4.0)
· d1a60842
Zandor Smith
authored
Nov 29, 2021
d1a60842
Hide whitespace changes
Inline
Side-by-side
package.json
View file @
d1a60842
{
"name"
:
"@zandor300/react-apple-mapkitjs"
,
"version"
:
"0.
3.1
"
,
"version"
:
"0.
4.0
"
,
"description"
:
"A react wrapper for apple mapkit.js"
,
"main"
:
"lib/index.js"
,
"scripts"
:
{
...
...
src/lib/AppleMaps.js
View file @
d1a60842
...
...
@@ -184,10 +184,10 @@ class AppleMaps extends Component {
}
setMainCoords
()
{
const
{
longitude
,
latitude
}
=
this
.
props
const
{
longitude
,
latitude
,
spanLat
,
spanLong
}
=
this
.
props
const
mainCoords
=
new
mapkit
.
CoordinateRegion
(
new
mapkit
.
Coordinate
(
latitude
,
longitude
),
new
mapkit
.
CoordinateSpan
(
this
.
zoomLevel
(),
this
.
zoomLevel
())
new
mapkit
.
CoordinateSpan
(
spanLat
?
spanLat
:
this
.
zoomLevel
(),
spanLong
?
spanLong
:
this
.
zoomLevel
())
)
this
.
map
.
region
=
mainCoords
}
...
...