Skip to content

Commit

Permalink
Merge pull request #383 from hdmm3/issue382
Browse files Browse the repository at this point in the history
Issue 382: current viewState params
  • Loading branch information
dcooley authored May 16, 2024
2 parents bffbca6 + 5f32e22 commit 8619ad4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions inst/htmlwidgets/mapdeck_location.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ function md_change_location( map_id, map_type, location, zoom, pitch, bearing, d
currentMaxPitch = window[ map_id + 'map'].viewState["default-view"].maxPitch;
currentMinPitch = window[ map_id + 'map'].viewState["default-view"].minPitch;
} else {
currentLon = (location === null || location.length == 0) ? window[ map_id + 'map'].viewState.longitude : location[0];
currentLat = (location === null || location.length == 0) ? window[ map_id + 'map'].viewState.latitude : location[1];
currentPitch = pitch === null ? window[ map_id + 'map'].viewState.pitch : pitch;
currentBearing = bearing === null ? window[ map_id + 'map' ].viewState.bearing : bearing;
currentZoom = zoom === null ? window[ map_id + 'map'].viewState.zoom : zoom;
currentMaxZoom = window[ map_id + 'map'].viewState.maxZoom;
currentMinZoom = window[ map_id + 'map'].viewState.minZoom;
currentMaxPitch = window[ map_id + 'map'].viewState.maxPitch;
currentMinPitch = window[ map_id + 'map'].viewState.minPitch;
currentLon = (location === null || location.length == 0) ? window[ map_id + 'map'].viewState.map.longitude : location[0];
currentLat = (location === null || location.length == 0) ? window[ map_id + 'map'].viewState.map.latitude : location[1];
currentPitch = pitch === null ? window[ map_id + 'map'].viewState.map.pitch : pitch;
currentBearing = bearing === null ? window[ map_id + 'map' ].viewState.map.bearing : bearing;
currentZoom = zoom === null ? window[ map_id + 'map'].viewState.map.zoom : zoom;
currentMaxZoom = window[ map_id + 'map'].viewState.map.maxZoom;
currentMinZoom = window[ map_id + 'map'].viewState.map.minZoom;
currentMaxPitch = window[ map_id + 'map'].viewState.map.maxPitch;
currentMinPitch = window[ map_id + 'map'].viewState.map.minPitch;
}

console.log( currentLon );
Expand Down

0 comments on commit 8619ad4

Please sign in to comment.