-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '3d-tiles' into 3d-tiles-texture-compresseion
- Loading branch information
Showing
65 changed files
with
2,637 additions
and
580 deletions.
There are no files selected for viewing
This file contains 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 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,90 @@ | ||
<!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="Cluster labels, billboards and points."> | ||
<meta name="cesium-sandcastle-labels" content="Tutorials,Showcases"> | ||
<title>Cesium Demo</title> | ||
<script type="text/javascript" src="../Sandcastle-header.js"></script> | ||
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script> | ||
<script type="text/javascript"> | ||
require.config({ | ||
baseUrl : '../../../Source', | ||
waitSeconds : 60 | ||
}); | ||
</script> | ||
</head> | ||
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html"> | ||
<style> | ||
@import url(../templates/bucket.css); | ||
#toolbar { | ||
background: rgba(42, 42, 42, 0.8); | ||
padding: 4px; | ||
border-radius: 4px; | ||
} | ||
#toolbar input { | ||
vertical-align: middle; | ||
padding-top: 2px; | ||
padding-bottom: 2px; | ||
} | ||
</style> | ||
<div id="cesiumContainer" class="fullSize"></div> | ||
<div id="loadingOverlay"><h1>Loading...</h1></div> | ||
<script id="cesium_sandcastle_script"> | ||
function startup(Cesium) { | ||
'use strict'; | ||
//Sandcastle_Begin | ||
|
||
/** | ||
* This class is an example of a custom geocoder. It provides geocoding through the OpenStreetMap Nominatim service. | ||
* @alias OpenStreetMapNominatimGeocoder | ||
* @constructor | ||
*/ | ||
function OpenStreetMapNominatimGeocoder() { | ||
} | ||
|
||
/** | ||
* The function called to geocode using this geocoder service. | ||
* | ||
* @param {String} input The query to be sent to the geocoder service | ||
* @returns {Promise<GeocoderResult[]>} | ||
*/ | ||
OpenStreetMapNominatimGeocoder.prototype.geocode = function (input) { | ||
var endpoint = 'http://nominatim.openstreetmap.org/search?'; | ||
var query = 'format=json&q=' + input; | ||
var requestString = endpoint + query; | ||
return Cesium.loadJson(requestString) | ||
.then(function (results) { | ||
var bboxDegrees; | ||
return results.map(function (resultObject) { | ||
bboxDegrees = resultObject.boundingbox; | ||
return { | ||
displayName: resultObject.display_name, | ||
destination: Cesium.Rectangle.fromDegrees( | ||
bboxDegrees[2], | ||
bboxDegrees[0], | ||
bboxDegrees[3], | ||
bboxDegrees[1] | ||
) | ||
}; | ||
}); | ||
}); | ||
}; | ||
|
||
var viewer = new Cesium.Viewer('cesiumContainer', { | ||
geocoder: new OpenStreetMapNominatimGeocoder() | ||
}); | ||
|
||
//Sandcastle_End | ||
Sandcastle.finishedLoading(); | ||
} | ||
if (typeof Cesium !== "undefined") { | ||
startup(Cesium); | ||
} else if (typeof require === "function") { | ||
require(["Cesium"], startup); | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains 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,52 @@ | ||
<!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="Demo the minimum set of options needed to remove all external dependencies, for offline operation."> | ||
<meta name="cesium-sandcastle-labels" content="Beginner, Showcases"> | ||
<title>Cesium Demo</title> | ||
<script type="text/javascript" src="../Sandcastle-header.js"></script> | ||
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script> | ||
<script type="text/javascript"> | ||
require.config({ | ||
baseUrl : '../../../Source', | ||
waitSeconds : 60 | ||
}); | ||
</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"> | ||
function startup(Cesium) { | ||
'use strict'; | ||
//Sandcastle_Begin | ||
// This is an example of using Cesium "Offline", meaning disconnected from the | ||
// external Internet. It must still be served from a local web server, but | ||
// does not rely on any outside resources or services. For more info, see: | ||
// https://github.com/AnalyticalGraphicsInc/cesium/wiki/Offline-Guide | ||
|
||
var viewer = new Cesium.Viewer('cesiumContainer', { | ||
imageryProvider : Cesium.createTileMapServiceImageryProvider({ | ||
url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII') | ||
}), | ||
baseLayerPicker : false, | ||
geocoder : false | ||
}); | ||
//Sandcastle_End | ||
Sandcastle.finishedLoading(); | ||
} | ||
if (typeof Cesium !== "undefined") { | ||
startup(Cesium); | ||
} else if (typeof require === "function") { | ||
require(["Cesium"], startup); | ||
} | ||
</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 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 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 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 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,107 @@ | ||
/*global define*/ | ||
define([ | ||
'./BingMapsApi', | ||
'./defaultValue', | ||
'./defined', | ||
'./defineProperties', | ||
'./DeveloperError', | ||
'./loadJsonp', | ||
'./Rectangle' | ||
], function( | ||
BingMapsApi, | ||
defaultValue, | ||
defined, | ||
defineProperties, | ||
DeveloperError, | ||
loadJsonp, | ||
Rectangle) { | ||
'use strict'; | ||
|
||
var url = 'https://dev.virtualearth.net/REST/v1/Locations'; | ||
|
||
/** | ||
* Provides geocoding through Bing Maps. | ||
* @alias BingMapsGeocoderService | ||
* @constructor | ||
* | ||
* @param {Object} options Object with the following properties: | ||
* @param {String} [key] A key to use with the Bing Maps geocoding service | ||
* @param {Boolean} autoComplete Indicates whether this service shall be used to fetch auto-complete suggestions | ||
*/ | ||
function BingMapsGeocoderService(options) { | ||
options = defaultValue(options, defaultValue.EMPTY_OBJECT); | ||
this._url = 'https://dev.virtualearth.net/REST/v1/Locations'; | ||
this._key = BingMapsApi.getKey(options.key); | ||
} | ||
|
||
defineProperties(BingMapsGeocoderService.prototype, { | ||
/** | ||
* The URL endpoint for the Bing geocoder service | ||
* @type {String} | ||
* @memberof {BingMapsGeocoderService.prototype} | ||
* @readonly | ||
*/ | ||
url : { | ||
get : function () { | ||
return this._url; | ||
} | ||
}, | ||
|
||
/** | ||
* The key for the Bing geocoder service | ||
* @type {String} | ||
* @memberof {BingMapsGeocoderService.prototype} | ||
* @readonly | ||
*/ | ||
key : { | ||
get : function () { | ||
return this._key; | ||
} | ||
} | ||
}); | ||
|
||
/** | ||
* @function | ||
* | ||
* @param {String} query The query to be sent to the geocoder service | ||
* @returns {Promise<GeocoderResult[]>} | ||
*/ | ||
BingMapsGeocoderService.prototype.geocode = function(query) { | ||
//>>includeStart('debug', pragmas.debug); | ||
if (!defined(query)) { | ||
throw new DeveloperError('query must be defined'); | ||
} | ||
//>>includeEnd('debug'); | ||
|
||
var key = this.key; | ||
var promise = loadJsonp(url, { | ||
parameters : { | ||
query : query, | ||
key : key | ||
}, | ||
callbackParameterName : 'jsonp' | ||
}); | ||
|
||
return promise.then(function(result) { | ||
if (result.resourceSets.length === 0) { | ||
return []; | ||
} | ||
|
||
var results = result.resourceSets[0].resources; | ||
|
||
return results.map(function (resource) { | ||
var bbox = resource.bbox; | ||
var south = bbox[0]; | ||
var west = bbox[1]; | ||
var north = bbox[2]; | ||
var east = bbox[3]; | ||
return { | ||
displayName: resource.name, | ||
destination: Rectangle.fromDegrees(west, south, east, north) | ||
}; | ||
}); | ||
}); | ||
}; | ||
|
||
return BingMapsGeocoderService; | ||
}); |
Oops, something went wrong.