mirror of
https://github.com/jiawanlong/Cesium-Examples.git
synced 2025-07-04 15:17:36 +00:00
官方示例
This commit is contained in:
parent
5d997af6a9
commit
866c624ec3
@ -1,4 +1,6 @@
|
||||
/* by jiawanlong*/
|
||||
|
||||
|
||||
var identification = {
|
||||
name: "Leaflet"
|
||||
};
|
||||
|
77
examples/cesiumGf/config.js
Normal file
77
examples/cesiumGf/config.js
Normal file
@ -0,0 +1,77 @@
|
||||
/* by jiawanlong*/
|
||||
var identification = {
|
||||
name: "Leaflet"
|
||||
};
|
||||
|
||||
|
||||
var exampleConfig = {
|
||||
"base": {
|
||||
name: "base",
|
||||
name_en: "base",
|
||||
content: {
|
||||
"map": {
|
||||
name: "base",
|
||||
name_en: "base",
|
||||
content: [
|
||||
// {
|
||||
// name: "1.1、默认设置",
|
||||
// thumbnail: "1.1、默认设置.png",
|
||||
// fileName: "1.1、默认设置"
|
||||
// },
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
};
|
||||
gallery_demos.forEach(element => {
|
||||
exampleConfig.base.content.map.content.push({
|
||||
name: element.name,
|
||||
fileName: 'https://sandcastle.cesium.com/gallery/' + element.name + '.html',
|
||||
thumbnail: 'https://sandcastle.cesium.com/gallery/' + element.img + '',
|
||||
})
|
||||
});
|
||||
|
||||
/**
|
||||
*key值:为exampleConfig配置的key值或者fileName值
|
||||
* (为中间节点时是key值,叶结点是fileName值)
|
||||
*value值:fontawesome字体icon名
|
||||
*不分层
|
||||
*/
|
||||
var sideBarIconConfig = {
|
||||
"base": "fa-server",
|
||||
"iPortal": "fa-desktop",
|
||||
"Online": "fa-cloud",
|
||||
"iManager": "fa-group",
|
||||
"Elasticsearch": "fa-tasks",
|
||||
"plot": "fa-edit",
|
||||
"dynamicPlot": "fa-pencil",
|
||||
"control": "fa-sliders",
|
||||
"components": "fa-window-restore",
|
||||
"clientSpatialAnalyst": "fa-object-group",
|
||||
"viz": "fa-map",
|
||||
"OGC": "fa-globe",
|
||||
"mapping": "fa-send"
|
||||
};
|
||||
|
||||
/**
|
||||
*key值:为exampleConfig配置的key值
|
||||
*value值:fontawesome字体icon名
|
||||
*与sideBarIconConfig的区别:sideBarIconConfig包括侧边栏所有层级目录的图标,exampleIconConfig仅包括一级标题的图标
|
||||
*/
|
||||
var exampleIconConfig = {
|
||||
"base": "fa-server",
|
||||
"iPortal": "fa-desktop",
|
||||
"Online": "fa-cloud",
|
||||
"iManager": "fa-group",
|
||||
"Elasticsearch": "fa-tasks",
|
||||
"plot": "fa-edit",
|
||||
"dynamicPlot": "fa-pencil",
|
||||
"control": "fa-sliders",
|
||||
"components": "fa-window-restore",
|
||||
"clientSpatialAnalyst": "fa-object-group",
|
||||
"viz": "fa-map",
|
||||
"OGC": "fa-globe",
|
||||
"mapping": "fa-send"
|
||||
};
|
||||
window.leafletExampleConfig = exampleConfig;
|
118
examples/cesiumGf/editor.html
Normal file
118
examples/cesiumGf/editor.html
Normal file
File diff suppressed because one or more lines are too long
491
examples/cesiumGf/examples.html
Normal file
491
examples/cesiumGf/examples.html
Normal file
File diff suppressed because one or more lines are too long
@ -89,12 +89,18 @@ function loadExampleHtml() {
|
||||
if (!locationParam) {
|
||||
return;
|
||||
}
|
||||
var href = window.location.toString();
|
||||
var mapUrl = href.substr(0, href.lastIndexOf('/') + 1);
|
||||
mapUrl = mapUrl + locationParam + ".html";
|
||||
if (!mapUrl) {
|
||||
return;
|
||||
var mapUrl;
|
||||
if (locationParam.indexOf('http') > -1) {
|
||||
mapUrl = locationParam
|
||||
}else{
|
||||
var href = window.location.toString();
|
||||
mapUrl = href.substr(0, href.lastIndexOf('/') + 1);
|
||||
mapUrl = mapUrl + locationParam + ".html";
|
||||
if (!mapUrl) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// console.log(mapUrl);
|
||||
var isError = false;
|
||||
var response = $.ajax({
|
||||
url: mapUrl,
|
||||
|
@ -111,8 +111,14 @@ function createGalleryChart(example) {
|
||||
var target = "editor.html",
|
||||
defaultThumb = "../img/thumb.png",
|
||||
title = utils.getLocalPairs(example, "name"),
|
||||
href = example.fileName ? example.fileName : "",
|
||||
thumbnail = example.thumbnail ? thumbLocation + "/img/" + example.thumbnail : "",
|
||||
href = example.fileName ? example.fileName : "";
|
||||
let thumbnail;
|
||||
if ( example.thumbnail .indexOf('http') > -1) {
|
||||
thumbnail = example.thumbnail
|
||||
}else{
|
||||
thumbnail = example.thumbnail ? thumbLocation + "/img/" + example.thumbnail : "";
|
||||
}
|
||||
// thumbnail = example.thumbnail ? thumbLocation + "/img/" + example.thumbnail : "";
|
||||
version = example.version;
|
||||
|
||||
var chartDiv = $("<div class='col-xlg-2 col-lg-3 col-md-4 col-sm-6 col-xs-12'></div>");
|
||||
@ -124,7 +130,7 @@ function createGalleryChart(example) {
|
||||
}
|
||||
|
||||
var chartTitle = $("<h5 class='chart-title'>" + title + "</h5>");
|
||||
var newTip = $('<svg xmlns="http://www.w3.org/2000/svg" class="new-example" style="width:8px !important;height:8px;right: 1px;top: 1px;position: absolute;"><circle cx="4" cy="4" r="4" fill="var(--active-color)"></circle></svg>');
|
||||
var newTip = $('');
|
||||
var thumb = $("<img class='chart-thumb' src='" + defaultThumb + "' data-original='" + thumbnail + "' style='display: inline'>");
|
||||
|
||||
chartTitle.appendTo(link);
|
||||
|
@ -161,7 +161,6 @@ function createSideBarMenuTitle(id, title, collapse, hasNewExamples) {
|
||||
var titleBar = $("<span class='sidebar-title-bar'></span>");
|
||||
var newIcon = "";
|
||||
if (hasNewExamples) {
|
||||
newIcon = "<svg style='width:16px;height:16px;padding-left:5px'><circle cx='3' cy='3' r='3' fill='var(--active-color)'></circle>/svg>";
|
||||
}
|
||||
var firstMenuTitle = $("<span class='firstMenuTitle'>" + title + newIcon + "</span>");
|
||||
titleBar.append(firstMenuTitle);
|
||||
@ -182,7 +181,6 @@ function createSideBarMenuSecondTitle(id, title, collapse, hasNewExamples) {
|
||||
}
|
||||
var newIcon = "";
|
||||
if (hasNewExamples) {
|
||||
newIcon = "<svg style='width:16px;height:16px;padding-left:5px'><circle cx='3' cy='3' r='3' fill='var(--active-color)'></circle>/svg>";
|
||||
}
|
||||
var div = $(
|
||||
"<a href='#" + id + "' id='" + id + '-' + id + "'>" + icon +
|
||||
@ -204,7 +202,6 @@ function createSideBarMenuThirdTitle(id, title, collapse,version) {
|
||||
}
|
||||
var newIcon="";
|
||||
if(window.version===version){
|
||||
newIcon = "<svg style='width:16px;height:16px;padding-left:5px'><circle cx='3' cy='3' r='3' fill='var(--active-color)'></circle>/svg>";
|
||||
}
|
||||
|
||||
var div = $(
|
||||
|
@ -53,6 +53,9 @@
|
||||
<li class="navbar-menu" id="mapboxgl-menu">
|
||||
<a class="center" target="_self" href="../webgpuEx/examples.html">WebGPU Demo</a>
|
||||
</li>
|
||||
<li class="navbar-menu" id="mapboxgl-menu">
|
||||
<a class="center" target="_self" href="../cesiumGf/examples.html">Cesium GF</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user