Created
April 25, 2017 05:31
-
-
Save geog4046instructor/43e898a56e4a26da2a6d6c001c1859da to your computer and use it in GitHub Desktop.
Revisions
-
geog4046instructor created this gist
Apr 25, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ /* Change the map or scene view by making the camera "fly" to a new latitude and longitude. Note the lat/lng are reversed. * */ map.flyTo( [34.69, -117.76], 8, { animate:true, duration:1 } ) // for Leaflet maps scene.goTo({ center: [-117.76, 34.69], zoom: 8 }) // for ArcGIS web scenes /* To change the camera location but keep the current zoom level, you could provide flyTo and goTo with a zoom value equal * to the map or scene's current zoom obtained with the map.getZoom() method in Leaflet and the scene.zoom property in ArcGIS. */ map.flyTo( [lat, lng], map.getZoom(), { animate:true, duration:1 } ) // for leaflet scene.goTo({ center: [lng, lat], zoom: scene.zoom }) // for ArcGIS