-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Google2D & Azure2D ImageryProvider classes #12913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
2d187ad
wip
lukemckinstry 7cb61c0
init google
lukemckinstry 154e6e8
google 2d wip
lukemckinstry b70e0e2
google 2d api docs
lukemckinstry 2853e6d
google 2d updates
lukemckinstry b8c7df5
add azure 2d imagery provider class
lukemckinstry 5fd1716
implement getTileCredits
lukemckinstry 0e003c8
stream via ion wip
lukemckinstry 2a2dbc1
use IonResource for external imagery types
lukemckinstry d58748a
use ion resource retry to reset session query parameter for Google 2d…
lukemckinstry 95819da
fixups for refresh logic
lukemckinstry 8a45264
sandcastle - add google 2d
lukemckinstry cb6d016
wip google fromMapType endpoint
lukemckinstry c4fd6fe
jsdoc fix
lukemckinstry 66d2fb3
Azure 2D Maps use ion proxy
lukemckinstry 4f1be5d
Azure 2D Maps sandcastle
lukemckinstry 26f4755
Azure ion token refresh
lukemckinstry 51f9ae5
cleanup
lukemckinstry 9e869f1
add google overlay and styling params to imagery provider api
lukemckinstry 0913984
google overlay and styling fixups
lukemckinstry f5276ea
sandcastle - google overlay and styles
lukemckinstry fcd8e08
move from session token to constructor
lukemckinstry 66ecf4c
wip - add support for custom maps and overlays via ion
lukemckinstry 7080a35
wip tile availability
lukemckinstry d11c001
google style options via ion
lukemckinstry 0ccbdd0
fixup availability rollback
lukemckinstry 9259bd9
add imagery available from ion sandcastle
lukemckinstry 0ee41e5
wip google 2d ip specs
lukemckinstry 50ae785
remove cache in google 2d from ion
lukemckinstry 160c17f
add v2 sandcastles
lukemckinstry 4622d17
gather viewport attribution when google provider loads
lukemckinstry e291f07
increase default width of attribution popup
lukemckinstry 21bfcf9
add specs for request image process
lukemckinstry b466ef4
rename custom styles sandcastle
lukemckinstry 4bc35e3
update key in ion resource retry callback
lukemckinstry 242e459
use ion resource for fromIon
lukemckinstry fa93e62
cleanup request image
lukemckinstry a5ca6fb
docs updates, add examples and links
lukemckinstry 2373596
cleanup
lukemckinstry 54a042e
specs cleanup
lukemckinstry bfd5110
add google types to ion world imagery style
lukemckinstry 59d2779
fixups to google 2d imagery provider
lukemckinstry 648b0e3
cleanup specs and checks
lukemckinstry f7ebec7
remove geocoder check pending decision
lukemckinstry ce54384
mark google 2d provider constructor private
lukemckinstry 0a4db5c
add sandcastle thumbnails
lukemckinstry 78656e6
update default base layer picker options
lukemckinstry 19ba0d2
pr feedback fixups
lukemckinstry a756739
use GoogleMaps mapTilesApiEndpoint and defaultApiKey
lukemckinstry ba95957
spec fixes
lukemckinstry 9fd62df
document attribution function
lukemckinstry ac27462
cleanup
lukemckinstry 420650e
organize options passing
lukemckinstry 994c6e6
update changelog
lukemckinstry d36a586
azure 2d provider updates
lukemckinstry 80d41ec
add azxure 2d specs
lukemckinstry bbe42b2
default azure max zoom 22
lukemckinstry 2df3d24
Refactor ion resource refresh token callbacks and credit
ggetz 9f7ff6e
Fix jsdoc
ggetz 8b801e6
prettier
lukemckinstry 0905d8a
undo ion resource refactor
lukemckinstry fd24d66
remove azure assets from ion showcase for now
lukemckinstry 3beb45e
move azure sandcastles to development
lukemckinstry 96390e4
update sandcastle descriptions
lukemckinstry 8ddcf0c
fixups
lukemckinstry f74fa57
update to prod asset ids
lukemckinstry 85eb619
prod asset ID updates
lukemckinstry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
94 changes: 94 additions & 0 deletions
94
Apps/Sandcastle/gallery/Google 2D Tiles with Custom Styles.html
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
| <meta | ||
| name="viewport" | ||
| content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" | ||
| /> | ||
| <meta | ||
| name="description" | ||
| content="Imagery tiles from Google Maps with additional parameters to create overlays and custom styles." | ||
| /> | ||
| <meta name="cesium-sandcastle-labels" content="Beginner, Showcases" /> | ||
| <title>Cesium Demo</title> | ||
| <script type="text/javascript" src="../Sandcastle-header.js"></script> | ||
| <script type="module" src="../load-cesium-es6.js"></script> | ||
| </head> | ||
| <body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html"> | ||
| <style> | ||
| @import url(../templates/bucket.css); | ||
| </style> | ||
| <div id="cesiumContainer" class="fullSize"></div> | ||
| <div id="loadingOverlay"><h1>Loading...</h1></div> | ||
| <div id="toolbar"></div> | ||
| <script id="cesium_sandcastle_script"> | ||
| window.startup = async function (Cesium) { | ||
| "use strict"; | ||
| //Sandcastle_Begin | ||
| const assetId = 3830184; | ||
|
|
||
| const base = Cesium.ImageryLayer.fromProviderAsync( | ||
| Cesium.Google2DImageryProvider.fromIonAssetId({ | ||
| assetId, | ||
| mapType: "satellite", | ||
| }), | ||
| ); | ||
|
|
||
| const overlay = Cesium.ImageryLayer.fromProviderAsync( | ||
| Cesium.Google2DImageryProvider.fromIonAssetId({ | ||
| assetId, | ||
| overlayLayerType: "layerRoadmap", | ||
| styles: [ | ||
| { | ||
| stylers: [{ hue: "#00ffe6" }, { saturation: -20 }], | ||
| }, | ||
| { | ||
| featureType: "road", | ||
| elementType: "geometry", | ||
| stylers: [{ lightness: 100 }, { visibility: "simplified" }], | ||
| }, | ||
| ], | ||
| }), | ||
| ); | ||
|
|
||
| const viewer = new Cesium.Viewer("cesiumContainer", { | ||
| animation: false, | ||
| baseLayer: false, | ||
| baseLayerPicker: false, | ||
| geocoder: Cesium.IonGeocodeProviderType.GOOGLE, | ||
| timeline: false, | ||
| sceneModePicker: false, | ||
| navigationHelpButton: false, | ||
| homeButton: false, | ||
| terrainProvider: await Cesium.CesiumTerrainProvider.fromIonAssetId(1), | ||
| }); | ||
| viewer.geocoder.viewModel.keepExpanded = true; | ||
|
|
||
| viewer.imageryLayers.add(base); | ||
| viewer.imageryLayers.add(overlay); | ||
|
|
||
| viewer.scene.camera.flyTo({ | ||
| duration: 0, | ||
| destination: new Cesium.Rectangle.fromDegrees( | ||
| //Philly | ||
| -75.280266, | ||
| 39.867004, | ||
| -74.955763, | ||
| 40.137992, | ||
| ), | ||
| }); | ||
| //Sandcastle_End | ||
| Sandcastle.finishedLoading(); | ||
| }; | ||
| if (typeof Cesium !== "undefined") { | ||
| window.startupCalled = true; | ||
| window.startup(Cesium).catch((error) => { | ||
| "use strict"; | ||
| console.error(error); | ||
| }); | ||
| } | ||
| </script> | ||
| </body> | ||
| </html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
| <meta | ||
| name="viewport" | ||
| content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" | ||
| /> | ||
| <meta name="description" content="Global imagery data from Google Maps." /> | ||
| <meta name="cesium-sandcastle-labels" content="Beginner, Showcases" /> | ||
| <title>Cesium Demo</title> | ||
| <script type="text/javascript" src="../Sandcastle-header.js"></script> | ||
| <script type="module" src="../load-cesium-es6.js"></script> | ||
| </head> | ||
| <body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html"> | ||
| <style> | ||
| @import url(../templates/bucket.css); | ||
| </style> | ||
| <div id="cesiumContainer" class="fullSize"></div> | ||
| <div id="loadingOverlay"><h1>Loading...</h1></div> | ||
| <div id="toolbar"></div> | ||
| <script id="cesium_sandcastle_script"> | ||
| window.startup = async function (Cesium) { | ||
| "use strict"; | ||
| //Sandcastle_Begin | ||
| const assetId = 3830184; | ||
|
|
||
| const google = Cesium.ImageryLayer.fromProviderAsync( | ||
| Cesium.IonImageryProvider.fromAssetId(assetId), | ||
| ); | ||
|
|
||
| const viewer = new Cesium.Viewer("cesiumContainer", { | ||
| animation: false, | ||
| baseLayer: false, | ||
| baseLayerPicker: false, | ||
| geocoder: Cesium.IonGeocodeProviderType.GOOGLE, | ||
| timeline: false, | ||
| sceneModePicker: false, | ||
| navigationHelpButton: false, | ||
| homeButton: false, | ||
| terrainProvider: await Cesium.CesiumTerrainProvider.fromIonAssetId(1), | ||
| }); | ||
| viewer.geocoder.viewModel.keepExpanded = true; | ||
|
|
||
| viewer.imageryLayers.add(google); | ||
|
|
||
| viewer.scene.camera.flyTo({ | ||
| duration: 0, | ||
| destination: new Cesium.Rectangle.fromDegrees( | ||
| //Philly | ||
| -75.280266, | ||
| 39.867004, | ||
| -74.955763, | ||
| 40.137992, | ||
| ), | ||
| }); //Sandcastle_End | ||
| Sandcastle.finishedLoading(); | ||
| }; | ||
| if (typeof Cesium !== "undefined") { | ||
| window.startupCalled = true; | ||
| window.startup(Cesium).catch((error) => { | ||
| "use strict"; | ||
| console.error(error); | ||
| }); | ||
| } | ||
| </script> | ||
| </body> | ||
| </html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
98 changes: 98 additions & 0 deletions
98
Apps/Sandcastle/gallery/Imagery Assets available from ion.html
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
| <meta | ||
| name="viewport" | ||
| content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" | ||
| /> | ||
| <meta name="description" content="Global imagery assets available from Cesium ion." /> | ||
| <meta name="cesium-sandcastle-labels" content="Beginner, Showcases" /> | ||
| <title>Cesium Demo</title> | ||
| <script type="text/javascript" src="../Sandcastle-header.js"></script> | ||
| <script type="module" src="../load-cesium-es6.js"></script> | ||
| </head> | ||
| <body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html"> | ||
| <style> | ||
| @import url(../templates/bucket.css); | ||
| </style> | ||
| <div id="cesiumContainer" class="fullSize"></div> | ||
| <div id="loadingOverlay"><h1>Loading...</h1></div> | ||
| <div id="toolbar"></div> | ||
| <script id="cesium_sandcastle_script"> | ||
| window.startup = async function (Cesium) { | ||
| "use strict"; | ||
| //Sandcastle_Begin | ||
| const viewer = new Cesium.Viewer("cesiumContainer", { | ||
| animation: false, | ||
| baseLayer: false, | ||
| baseLayerPicker: false, | ||
| geocoder: Cesium.IonGeocodeProviderType.GOOGLE, | ||
| timeline: false, | ||
| sceneModePicker: false, | ||
| navigationHelpButton: false, | ||
| homeButton: false, | ||
| terrainProvider: await Cesium.CesiumTerrainProvider.fromIonAssetId(1), | ||
| }); | ||
| viewer.geocoder.viewModel.keepExpanded = true; | ||
|
|
||
| const menuOptions = []; | ||
|
|
||
| const dropdownOptions = [ | ||
| { label: "Google Maps 2D Contour", assetId: 3830186 }, | ||
| { label: "Google Maps 2D Labels Only", assetId: 3830185 }, | ||
| { label: "Google Maps 2D Roadmap", assetId: 3830184 }, | ||
| { label: "Google Maps 2D Satellite", assetId: 3830182 }, | ||
| { label: "Google Maps 2D Satellite with Labels", assetId: 3830183 }, | ||
| { label: "Bing Maps Aerial", assetId: 2 }, | ||
| { label: "Bing Maps Aerial with Labels", assetId: 3 }, | ||
| { label: "Bing Maps Road", assetId: 4 }, | ||
| { label: "Bing Maps Labels Only", assetId: 2411391 }, | ||
| { label: "Sentinel-2", assetId: 3954 }, | ||
| ]; | ||
|
|
||
| function showLayer(assetId) { | ||
| viewer.imageryLayers.removeAll(true); | ||
| const layer = Cesium.ImageryLayer.fromProviderAsync( | ||
| Cesium.IonImageryProvider.fromAssetId(assetId), | ||
| ); | ||
| viewer.imageryLayers.add(layer); | ||
| } | ||
|
|
||
| dropdownOptions.forEach((opt) => { | ||
| const option = { | ||
| text: opt.label, | ||
| onselect: function () { | ||
| showLayer(opt.assetId); | ||
| }, | ||
| }; | ||
| menuOptions.push(option); | ||
| }); | ||
|
|
||
| Sandcastle.addToolbarMenu(menuOptions); | ||
|
|
||
| showLayer(3830186); | ||
|
|
||
| viewer.scene.camera.flyTo({ | ||
| duration: 0, | ||
| destination: new Cesium.Rectangle.fromDegrees( | ||
| //Philly | ||
| -75.280266, | ||
| 39.867004, | ||
| -74.955763, | ||
| 40.137992, | ||
| ), | ||
| }); //Sandcastle_End | ||
| Sandcastle.finishedLoading(); | ||
| }; | ||
| if (typeof Cesium !== "undefined") { | ||
| window.startupCalled = true; | ||
| window.startup(Cesium).catch((error) => { | ||
| "use strict"; | ||
| console.error(error); | ||
| }); | ||
| } | ||
| </script> | ||
| </body> | ||
| </html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
| <meta | ||
| name="viewport" | ||
| content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" | ||
| /> | ||
| <meta name="description" content="Global imagery data from Azure Maps." /> | ||
| <meta name="cesium-sandcastle-labels" content="Beginner, Showcases" /> | ||
| <title>Cesium Demo</title> | ||
| <script type="text/javascript" src="../Sandcastle-header.js"></script> | ||
| <script type="module" src="../load-cesium-es6.js"></script> | ||
| </head> | ||
| <body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html"> | ||
| <style> | ||
| @import url(../templates/bucket.css); | ||
| </style> | ||
| <div id="cesiumContainer" class="fullSize"></div> | ||
| <div id="loadingOverlay"><h1>Loading...</h1></div> | ||
| <div id="toolbar"></div> | ||
| <script id="cesium_sandcastle_script"> | ||
| window.startup = async function (Cesium) { | ||
| "use strict"; | ||
| //Sandcastle_Begin | ||
| Cesium.Ion.defaultServer = "https://api.ion-staging.cesium.com"; | ||
| Cesium.Ion.defaultAccessToken = ""; | ||
|
|
||
| const assetId = 1683; | ||
|
|
||
| const azure = Cesium.ImageryLayer.fromProviderAsync( | ||
| Cesium.IonImageryProvider.fromAssetId(assetId), | ||
| ); | ||
|
|
||
| const viewer = new Cesium.Viewer("cesiumContainer", { | ||
| animation: false, | ||
| baseLayer: false, | ||
| baseLayerPicker: false, | ||
| geocoder: Cesium.IonGeocodeProviderType.GOOGLE, | ||
| timeline: false, | ||
| sceneModePicker: false, | ||
| navigationHelpButton: false, | ||
| homeButton: false, | ||
| terrainProvider: await Cesium.CesiumTerrainProvider.fromIonAssetId(1), | ||
| }); | ||
| viewer.geocoder.viewModel.keepExpanded = true; | ||
|
|
||
| viewer.imageryLayers.add(azure); | ||
|
|
||
| viewer.scene.camera.flyTo({ | ||
| duration: 0, | ||
| destination: new Cesium.Rectangle.fromDegrees( | ||
| //Philly | ||
| -75.280266, | ||
| 39.867004, | ||
| -74.955763, | ||
| 40.137992, | ||
| ), | ||
| }); //Sandcastle_End | ||
| Sandcastle.finishedLoading(); | ||
| }; | ||
| if (typeof Cesium !== "undefined") { | ||
| window.startupCalled = true; | ||
| window.startup(Cesium).catch((error) => { | ||
| "use strict"; | ||
| console.error(error); | ||
| }); | ||
| } | ||
| </script> | ||
| </body> | ||
| </html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 characters
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 characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.