Skip to content

Commit

Permalink
reverting
Browse files Browse the repository at this point in the history
  • Loading branch information
dcooley committed May 21, 2024
1 parent 1ac4f0f commit a861082
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 27 deletions.
33 changes: 20 additions & 13 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: mapdeck
Type: Package
Title: Interactive Maps Using 'Mapbox GL JS' and 'Deck.gl'
Version: 0.3.5
Date: 2024-01-29
Version: 0.3.6
Date: 2024-05-21
Authors@R: c(
person("David", "Cooley", ,"[email protected]", role = c("aut", "cre"))
)
Expand All @@ -15,30 +15,29 @@ URL: https://symbolixau.github.io/mapdeck/articles/mapdeck.html
BugReports: https://github.com/SymbolixAU/mapdeck/issues
Encoding: UTF-8
LazyData: true
Depends: R (>= 3.5.0)
SystemRequirements: C++14
Depends: R (>= 4.0.0)
Imports:
colourvalues (>= 0.3.9),
colourvalues,
googlePolylines (>= 0.7.2),
geojsonsf (>= 2.0.3),
geojsonsf,
htmlwidgets,
jsonify (>= 1.2.2),
jsonify,
magrittr,
Rcpp (>= 1.0.10),
Rcpp,
shiny,
sfheaders (>= 0.4.4)
RoxygenNote: 7.2.3
sfheaders
RoxygenNote: 7.3.1
LinkingTo:
BH,
colourvalues (>= 0.3.9),
geojsonsf (>= 2.0.3),
geojsonsf (>= 2.0.4),
geometries (>= 0.2.4),
interleave (>= 0.1.2),
jsonify (>= 1.2.2),
jsonify (>= 1.2.3),
rapidjsonr,
Rcpp (>= 1.0.10),
sfheaders (>= 0.4.4),
spatialwidget (>= 0.2.5)
spatialwidget (>= 0.2.6)
Suggests:
covr,
googleway,
Expand All @@ -48,3 +47,11 @@ Suggests:
spatialwidget,
testthat
VignetteBuilder: knitr
remotes:
https://github.com/SymbolixAU/rapidjsonr,
https://github.com/SymbolixAU/jsonify,
https://github.com/SymbolixAU/geojsonsf,
https://github.com/dcooley/geometries,
https://github.com/dcooley/interleave,
https://github.com/dcooley/sfheaders,
https://github.com/SymbolixAU/spatialwidget
19 changes: 5 additions & 14 deletions inst/htmlwidgets/mapdeck_location.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,14 @@ function md_change_location( map_id, map_type, location, zoom, pitch, bearing, d
window[map_id + 'map'].setZoom( zoom );
} else {

console.log( window[ map_id + 'map' ].viewManager.viewState.longitude );

if ( window[ map_id + 'map'].viewManager.viewState["default-view"] !== undefined ) {
currentLon = (location === null || location.length == 0) ? window[ map_id + 'map'].viewManager.viewState["default-view"].longitude : location[0];
currentLat = (location === null || location.length == 0) ? window[ map_id + 'map'].viewManager.viewState["default-view"].latitude : location[1];
currentPitch = pitch === null ? window[ map_id + 'map'].viewManager.viewState["default-view"].pitch : pitch;
currentBearing = bearing === null ? window[ map_id + 'map' ].viewManager.viewState["default-view"].bearing : bearing;
currentZoom = zoom === null ? window[ map_id + 'map'].viewManager.viewState["default-view"].zoom : zoom;
currentMaxZoom = window[ map_id + 'map'].viewManager.viewState["default-view"].maxZoom;
currentMinZoom = window[ map_id + 'map'].viewManager.viewState["default-view"].minZoom;
currentMaxPitch = window[ map_id + 'map'].viewManager.viewState["default-view"].maxPitch;
currentMinPitch = window[ map_id + 'map'].viewManager.viewState["default-view"].minPitch;

currentViewState = window[ map_id + 'map'].viewManager.viewState["default-view"]
} else {
currentViewState = window[ map_id + 'map'].viewManager.viewState
}

currentViewState = window[ map_id + 'map'].viewManager.viewState
currentLon = (location === null || location.length == 0) ? currentViewState.longitude : location[0];
currentLat = (location === null || location.length == 0) ? currentViewState.latitude : location[1];
currentPitch = pitch === null ? currentViewState.pitch : pitch;
Expand All @@ -37,9 +31,6 @@ function md_change_location( map_id, map_type, location, zoom, pitch, bearing, d
currentMinZoom = currentViewState.minZoom;
currentMaxPitch = currentViewState.maxPitch;
currentMinPitch = currentViewState.minPitch;
}

console.log( currentLon );

window[map_id + 'map'].setProps({
viewState: {
Expand Down

0 comments on commit a861082

Please sign in to comment.