Skip to content

Commit

Permalink
Added Line And Circles example
Browse files Browse the repository at this point in the history
  • Loading branch information
Zemledelec committed Jul 29, 2024
1 parent 31dbeb5 commit 45bba5a
Show file tree
Hide file tree
Showing 22 changed files with 211 additions and 341 deletions.
44 changes: 5 additions & 39 deletions examples/baseLayers/baseLayers.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
Globe,
GlobusTerrain,
XYZ,
utils
utils,
OpenStreetMap,
Bing
} from "../../external/og/lib/@openglobus/og.esm.js";

document.getElementById("btnOSM").onclick = function () {
Expand All @@ -29,45 +31,9 @@
sat.setVisibility(true);
};

let osm = new XYZ("OpenStreetMap", {
isBaseLayer: true,
url: "//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
visibility: true,
attribution: 'Data @ OpenStreetMap contributors, ODbL'
});

function toQuadKey(x, y, z) {
var index = '';
for (let i = z; i > 0; i--) {
var b = 0;
var mask = 1 << (i - 1);
if ((x & mask) !== 0) b++;
if ((y & mask) !== 0) b += 2;
index += b.toString();
}
return index;
}

let sat = new XYZ("sat", {
subdomains: ['t0', 't1', 't2', 't3'],
url: "https://ecn.{s}.tiles.virtualearth.net/tiles/a{quad}.jpeg?n=z&g=7146",
isBaseLayer: true,
maxNativeZoom: 19,
defaultTextures: [{color: "#001522"}, {color: "#E4E6F3"}],
attribution: `<div style="transform: scale(0.8); margin-top:-2px;"><a href="http://www.bing.com" target="_blank"><img style="position: relative; top: 2px;" title="Bing Imagery" src="https://sandbox.openglobus.org/bing_maps_credit.png"></a> © 2021 Microsoft Corporation</div>`,
urlRewrite: function (s, u) {
return utils.stringTemplate(u, {
's': this._getSubdomain(),
'quad': toQuadKey(s.tileX, s.tileY, s.tileZoom)
});
},
specular: [0.00063, 0.00055, 0.00032],
ambient: "rgb(90,90,90)",
diffuse: "rgb(350,350,350)",
shininess: 20,
nightTextureCoefficient: 2.7
});
let osm = new OpenStreetMap();

let sat = new Bing()

let globus = new Globe({
target: "globus",
Expand Down
38 changes: 2 additions & 36 deletions examples/billboards/billboards.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@
Entity,
EntityCollection,
LonLat,
Vec3,
Globe,
GlobusTerrain,
XYZ,
Ellipsoid,
utils
Bing
} from "../../external/og/lib/@openglobus/og.esm.js";

function rnd(min, max) {
Expand Down Expand Up @@ -64,38 +61,7 @@
e.pickingObject.billboard.remove();
});

function toQuadKey(x, y, z) {
var index = '';
for (let i = z; i > 0; i--) {
var b = 0;
var mask = 1 << (i - 1);
if ((x & mask) !== 0) b++;
if ((y & mask) !== 0) b += 2;
index += b.toString();
}
return index;
}

let sat = new XYZ("sat", {
subdomains: ['t0', 't1', 't2', 't3'],
url: "https://ecn.{s}.tiles.virtualearth.net/tiles/a{quad}.jpeg?n=z&g=7146",
isBaseLayer: true,
maxNativeZoom: 19,
defaultTextures: [{color: "#001522"}, {color: "#E4E6F3"}],
attribution: `<div style="transform: scale(0.8); margin-top:-2px;"><a href="http://www.bing.com" target="_blank"><img style="position: relative; top: 2px;" title="Bing Imagery" src="https://sandbox.openglobus.org/bing_maps_credit.png"></a> © 2021 Microsoft Corporation</div>`,
urlRewrite: function (s, u) {
return utils.stringTemplate(u, {
's': this._getSubdomain(),
'quad': toQuadKey(s.tileX, s.tileY, s.tileZoom)
});
},
specular: [0.00063, 0.00055, 0.00032],
ambient: "rgb(90,90,90)",
diffuse: "rgb(350,350,350)",
shininess: 20,
nightTextureCoefficient: 2.7
});

let sat = new Bing();

let globus = new Globe({
target: "globus",
Expand Down
9 changes: 2 additions & 7 deletions examples/billboardsDragging/billboardsDragging.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
Globe,
Vector,
GlobusTerrain,
XYZ
OpenStreetMap
} from "../../external/og/lib/@openglobus/og.esm.js";

let pointLayer = new Vector("points", {
Expand Down Expand Up @@ -71,12 +71,7 @@
pickingObject = null;
});

let osm = new XYZ("OSM", {
isBaseLayer: true,
url: "//b.tile.openstreetmap.org/{z}/{x}/{y}.png",
visibility: true,
attribution: 'Data @ OpenStreetMap contributors, ODbL'
});
let osm = new OpenStreetMap();

let globe = new Globe({
target: "earth",
Expand Down
14 changes: 2 additions & 12 deletions examples/billboardsOnTheGround/billboardsOnTheGround.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@

import {
Entity,
Vec2,
Vec3,
Globe,
wgs84,
Vector,
GlobusTerrain,
XYZ,
OpenStreetMap,
LonLat,
math
} from "../../external/og/lib/@openglobus/og.esm.js";
Expand Down Expand Up @@ -49,15 +47,7 @@
'nodeCapacity': points.length
});

let osm = new XYZ("OpenStreetMap", {
specular: [0.0003, 0.00012, 0.00001],
shininess: 20,
diffuse: [0.89, 0.9, 0.83],
isBaseLayer: true,
url: "//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
visibility: true,
attribution: 'Data @ OpenStreetMap contributors, ODbL'
});
let osm = new OpenStreetMap();

let globus = new Globe({
target: "globus",
Expand Down
4 changes: 3 additions & 1 deletion examples/epsg4326/epsg4326.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
XYZ,
Globe,
control,
EmptyTerrain
EmptyTerrain,
CanvasTiles,
quadTreeStrategyType
} from "../../external/og/lib/@openglobus/og.esm.js";

const tg = new CanvasTiles("Tile grid", {
Expand Down
11 changes: 2 additions & 9 deletions examples/geoTexture2d/geoTexture2d.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,22 +129,15 @@
'use strict';

import {
Entity,
EntityCollection,
Globe,
GlobusTerrain,
XYZ,
OpenStreetMap,
GeoTexture2d,
Framebuffer,
Program
} from "../../external/og/lib/@openglobus/og.esm.js";

let osm = new XYZ("OpenStreetMap", {
isBaseLayer: true,
url: "//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
visibility: true,
attribution: 'Data @ OpenStreetMap contributors, ODbL'
});
let osm = new OpenStreetMap();

let geoTex = new GeoTexture2d("Vector Field", {
corners: [[-2.3565396747912852, 51.75253410564987], [2.173417790597063, 50.95010370686831], [1.26786087508808, 49.01434061915433], [-3.153942423073776, 49.72627636180551]],
Expand Down
36 changes: 2 additions & 34 deletions examples/geoVideo/geoVideo.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
import {
Globe,
GlobusTerrain,
XYZ,
Bing,
GeoVideo,
utils
} from "../../external/og/lib/@openglobus/og.esm.js";


Expand All @@ -33,38 +32,7 @@
globus.planet.flyExtent(lv.getExtent());
};

function toQuadKey(x, y, z) {
var index = '';
for (let i = z; i > 0; i--) {
var b = 0;
var mask = 1 << (i - 1);
if ((x & mask) !== 0) b++;
if ((y & mask) !== 0) b += 2;
index += b.toString();
}
return index;
}

let sat = new XYZ("sat", {
subdomains: ['t0', 't1', 't2', 't3'],
url: "https://ecn.{s}.tiles.virtualearth.net/tiles/a{quad}.jpeg?n=z&g=7146",
isBaseLayer: true,
maxNativeZoom: 19,
defaultTextures: [{color: "#001522"}, {color: "#E4E6F3"}],
attribution: `<div style="transform: scale(0.8); margin-top:-2px;"><a href="http://www.bing.com" target="_blank"><img style="position: relative; top: 2px;" title="Bing Imagery" src="https://sandbox.openglobus.org/bing_maps_credit.png"></a> © 2021 Microsoft Corporation</div>`,
urlRewrite: function (s, u) {
return utils.stringTemplate(u, {
's': this._getSubdomain(),
'quad': toQuadKey(s.tileX, s.tileY, s.tileZoom)
});
},
specular: [0.00063, 0.00055, 0.00032],
ambient: "rgb(90,90,90)",
diffuse: "rgb(350,350,350)",
shininess: 20,
nightTextureCoefficient: 2.7
});

let sat = new Bing();

let imergac = new GeoVideo("USA precipitation 08.05.2016", {
minZoom: 0,
Expand Down
10 changes: 2 additions & 8 deletions examples/layerAnimation/layerAnimation.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,12 @@
import {
Globe,
GlobusTerrain,
XYZ,
OpenStreetMap,
CanvasTiles,
control
} from "../../external/og/lib/@openglobus/og.esm.js";

let osm1 = new XYZ("osm-1", {
isBaseLayer: true,
url: "//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
maxNativeZoom: 19,
defaultTextures: [{color: "#AAD3DF"}, {color: "#F2EFE9"}],
isSRGB: false,
});
let osm1 = new OpenStreetMap();

let globus = new Globe({
target: "earth",
Expand Down
32 changes: 2 additions & 30 deletions examples/layerOpacity/layerOpacity.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
Globe,
GlobusTerrain,
XYZ,
utils
Bing
} from "../../external/og/lib/@openglobus/og.esm.js";


Expand All @@ -37,35 +37,7 @@
attribution: 'Data @ OpenStreetMap contributors, ODbL'
});

function toQuadKey(x, y, z) {
var index = '';
for (let i = z; i > 0; i--) {
var b = 0;
var mask = 1 << (i - 1);
if ((x & mask) !== 0) b++;
if ((y & mask) !== 0) b += 2;
index += b.toString();
}
return index;
}

let sat = new XYZ("sat", {
subdomains: ['t0', 't1', 't2', 't3'],
url: "https://ecn.{s}.tiles.virtualearth.net/tiles/a{quad}.jpeg?n=z&g=7146",
isBaseLayer: true,
maxNativeZoom: 19,
defaultTextures: [{ color: "#001522" }, { color: "#E4E6F3" }],
attribution: `<div style="transform: scale(0.8); margin-top:-2px;"><a href="http://www.bing.com" target="_blank"><img style="position: relative; top: 2px;" title="Bing Imagery" src="https://sandbox.openglobus.org/bing_maps_credit.png"></a> © 2021 Microsoft Corporation</div>`,
urlRewrite: function (s, u) {
return utils.stringTemplate(u, {
's': this._getSubdomain(),
'quad': toQuadKey(s.tileX, s.tileY, s.tileZoom)
});
},
shininess: 20,
nightTextureCoefficient: 2.7
});

let sat = new Bing();

var globus = new Globe({
target: "globus",
Expand Down
35 changes: 2 additions & 33 deletions examples/layerZIndex/layerZIndex.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
GlobusTerrain,
XYZ,
GeoImage,
utils
Bing
} from "../../external/og/lib/@openglobus/og.esm.js";

var maxZIndex = 0;
Expand All @@ -37,38 +37,7 @@
osm.setZIndex(++maxZIndex);
});

function toQuadKey(x, y, z) {
var index = '';
for (let i = z; i > 0; i--) {
var b = 0;
var mask = 1 << (i - 1);
if ((x & mask) !== 0) b++;
if ((y & mask) !== 0) b += 2;
index += b.toString();
}
return index;
}

let sat = new XYZ("sat", {
subdomains: ['t0', 't1', 't2', 't3'],
extent: [[-12, 38], [8, 53]],
url: "https://ecn.{s}.tiles.virtualearth.net/tiles/a{quad}.jpeg?n=z&g=7146",
isBaseLayer: true,
maxNativeZoom: 19,
defaultTextures: [{ color: "#001522" }, { color: "#E4E6F3" }],
attribution: `<div style="transform: scale(0.8); margin-top:-2px;"><a href="http://www.bing.com" target="_blank"><img style="position: relative; top: 2px;" title="Bing Imagery" src="https://sandbox.openglobus.org/bing_maps_credit.png"></a> © 2021 Microsoft Corporation</div>`,
urlRewrite: function (s, u) {
return utils.stringTemplate(u, {
's': this._getSubdomain(),
'quad': toQuadKey(s.tileX, s.tileY, s.tileZoom)
});
},
specular: [0.00063, 0.00055, 0.00032],
ambient: "rgb(90,90,90)",
diffuse: "rgb(350,350,350)",
shininess: 20,
nightTextureCoefficient: 2.7
});
let sat = new Bing();

sat.events.on("lclick", function () {
sat.setZIndex(++maxZIndex);
Expand Down
Loading

0 comments on commit 45bba5a

Please sign in to comment.