Skip to content

Commit 5b9c9f8

Browse files
updated structure and references in the index.html
1 parent 4ca0e33 commit 5b9c9f8

File tree

471 files changed

+871043
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

471 files changed

+871043
-9
lines changed
Lines changed: 282 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,282 @@
1+
/*
2+
* 3DCityDB-Web-Map
3+
* http://www.3dcitydb.org/
4+
*
5+
* Copyright 2015 - 2017
6+
* Chair of Geoinformatics
7+
* Technical University of Munich, Germany
8+
* https://www.gis.bgu.tum.de/
9+
*
10+
* The 3DCityDB-Web-Map is jointly developed with the following
11+
* cooperation partners:
12+
*
13+
* virtualcitySYSTEMS GmbH, Berlin <http://www.virtualcitysystems.de/>
14+
*
15+
* Licensed under the Apache License, Version 2.0 (the "License");
16+
* you may not use this file except in compliance with the License.
17+
* You may obtain a copy of the License at
18+
*
19+
* http://www.apache.org/licenses/LICENSE-2.0
20+
*
21+
* Unless required by applicable law or agreed to in writing, software
22+
* distributed under the License is distributed on an "AS IS" BASIS,
23+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24+
* See the License for the specific language governing permissions and
25+
* limitations under the License.
26+
*/
27+
28+
/**
29+
* Defines the interface for a 3DCityDBLayer. This Object is an interface for
30+
* documentation purpose and is not intended to be instantiated directly.
31+
*
32+
* @alias Layer3DCityDB
33+
* @constructor
34+
*
35+
* @param {Object} [options] Object with the following properties:
36+
* @param {String} [options.url] url to the layer data
37+
* @param {String} [options.id] id of this layer
38+
* @param {String} [options.name] name of this layer
39+
* @param {String} [options.region] region/bbox of this layer Cesium.Rectangle
40+
*
41+
*/
42+
43+
function Layer3DCityDB(options) {
44+
/**
45+
* @type {Boolean}
46+
* if the layer is currently active
47+
*/
48+
this._active = false;
49+
/**
50+
* @type {Array}
51+
* HashMap of currently highlighted objects (objectid, color);
52+
*/
53+
this._highlightedObjects = {};
54+
/**
55+
* @type {Array}
56+
* list of currently hidden Objects
57+
*/
58+
this._hiddenObjects = [];
59+
/**
60+
* @type {Array}
61+
* list of eventhandler.
62+
*/
63+
this._eventhandler = [];
64+
/**
65+
* @type {Object} cameraPosition Object
66+
* see https://github.com/AnalyticalGraphicsInc/cesium/blob/1.11/Source/Scene/Camera.js#L2353 for options.
67+
*/
68+
this._cameraPosition = {};
69+
/**
70+
* @type {String} url
71+
*/
72+
this._url = options.url;
73+
/**
74+
* @type {String} name of the layer
75+
*/
76+
this._name = options.name;
77+
/**
78+
* @type {String} id of this layer
79+
* if not set by a given value an uuid is created
80+
*/
81+
this._id = options.id ? options.id : Cesium.createGuid();
82+
/**
83+
* @type {Cesium.Rectangle} region of the whole layer
84+
*/
85+
this._region = options.region;
86+
87+
/**
88+
* handles ClickEvents
89+
* @type {Cesium.Event} clickEvent
90+
*/
91+
this._clickEvent = new Cesium.Event();
92+
93+
/**
94+
* handles ClickEvents
95+
* @type {Cesium.Event} clickEvent
96+
*/
97+
this._mouseInEvent = new Cesium.Event();
98+
99+
/**
100+
* handles ClickEvents
101+
* @type {Cesium.Event} clickEvent
102+
*/
103+
this._mouseOutEvent = new Cesium.Event();
104+
}
105+
106+
defineProperties(Layer3DCityDB.prototype, {
107+
/**
108+
* returns if the layer is currently active
109+
* @memberof Layer3DCityDB.prototype
110+
* @type {Boolean}
111+
*/
112+
active: {
113+
get: Cesium.DeveloperError.throwInstantiationError
114+
},
115+
/**
116+
* Gets the currently highlighted Objects as an object hashmap {objectid, color}
117+
* @memberof Layer3DCityDB.prototype
118+
* @type {Object}
119+
*/
120+
highlightedObjects: {
121+
get: Cesium.DeveloperError.throwInstantiationError
122+
},
123+
/**
124+
* Gets the currently hidden Objects as an array
125+
* @memberof Layer3DCityDB.prototype
126+
* @type {Array}
127+
*/
128+
hiddenObjects: {
129+
get: Cesium.DeveloperError.throwInstantiationError
130+
},
131+
/**
132+
* Gets/Sets the CameraPosition.
133+
* @memberof Layer3DCityDB.prototype
134+
* @type {Object}
135+
* see https://github.com/AnalyticalGraphicsInc/cesium/blob/1.11/Source/Scene/Camera.js#L2353 for options.
136+
*/
137+
cameraPosition: {
138+
get: Cesium.DeveloperError.throwInstantiationError,
139+
set: Cesium.DeveloperError.throwInstantiationError
140+
},
141+
/**
142+
* Gets the url of the layer
143+
* @memberof Layer3DCityDB.prototype
144+
* @type {String}
145+
*/
146+
url: {
147+
get: Cesium.DeveloperError.throwInstantiationError
148+
},
149+
/**
150+
* Gets the name of this layer.
151+
* @memberof Layer3DCityDB.prototype
152+
* @type {String}
153+
*/
154+
name: {
155+
get: Cesium.DeveloperError.throwInstantiationError
156+
},
157+
/**
158+
* Gets the id of this layer, the id should be unique.
159+
* @memberof Layer3DCityDB.prototype
160+
* @type {String}
161+
*/
162+
id: {
163+
get: Cesium.DeveloperError.throwInstantiationError
164+
},
165+
/**
166+
* Gets region/bbox of this layer as an Cesium Rectangle Object with longitude/latitude values in radians.
167+
* @memberof Layer3DCityDB.prototype
168+
* @type {Cesium.Rectangle}
169+
*/
170+
region: {
171+
get: Cesium.DeveloperError.throwInstantiationError
172+
}
173+
174+
});
175+
176+
/**
177+
* activates or deactivates the layer
178+
* @param {Boolean} value
179+
*/
180+
Layer3DCityDB.prototype.activate = Cesium.DeveloperError.throwInstantiationError;
181+
182+
/**
183+
* highlights one or more object with a given color;
184+
* @param {Object<String, Cesium.Color>} An object hashMap with the objectId and a cesium Color
185+
*/
186+
Layer3DCityDB.prototype.highlight = Cesium.DeveloperError.throwInstantiationError;
187+
188+
/**
189+
* undo highlighting
190+
* @param {Array<String>} A list of Object Ids. The default material will be restored
191+
*/
192+
Layer3DCityDB.prototype.unHighlight = Cesium.DeveloperError.throwInstantiationError;
193+
194+
/**
195+
* hideObjects
196+
* @param {Array<String>} A list of Object Ids which will be hidden
197+
*/
198+
Layer3DCityDB.prototype.hideObjects = Cesium.DeveloperError.throwInstantiationError;
199+
200+
/**
201+
* showObjects, to undo hideObjects
202+
* @param {Array<String>} A list of Object Ids which will be unhidden.
203+
*/
204+
Layer3DCityDB.prototype.showObjects = Cesium.DeveloperError.throwInstantiationError;
205+
206+
/**
207+
* zooms to the layer cameraPostion
208+
*/
209+
Layer3DCityDB.prototype.zoomToStartPosition = Cesium.DeveloperError.throwInstantiationError;
210+
211+
/**
212+
* removes an Eventhandler
213+
* @param {String} event (either CLICK, MOUSEIN or MOUSEOUT)
214+
* @param {function} callback function to be called
215+
*/
216+
Layer3DCityDB.prototype.removeEventHandler = function (event, callback) {
217+
if (event == "CLICK") {
218+
this._clickEvent.removeEventListener(callback, this);
219+
} else if (event == "MOUSEIN") {
220+
this._mouseInEvent.removeEventListener(callback, this);
221+
} else if (event == "MOUSEOUT") {
222+
this._mouseOutEvent.removeEventListener(callback, this);
223+
}
224+
}
225+
226+
/**
227+
* adds an Eventhandler
228+
* @param {String} event (either CLICK, MOUSEIN or MOUSEOUT)
229+
* @param {function} callback function to be called
230+
* @return {String} id of the event Handler, can be used to remove the event Handler
231+
*/
232+
Layer3DCityDB.prototype.registerEventHandler = function (event, callback) {
233+
if (event == "CLICK") {
234+
this._clickEvent.addEventListener(callback, this);
235+
} else if (event == "MOUSEIN") {
236+
this._mouseInEvent.addEventListener(callback, this);
237+
} else if (event == "MOUSEOUT") {
238+
this._mouseOutEvent.addEventListener(callback, this);
239+
}
240+
}
241+
242+
/**
243+
* triggers an Event
244+
* @param {String} event (either CLICK, MOUSEIN or MOUSEOUT)
245+
* @param {Object} cesium object. Scene.pick result.
246+
*/
247+
Layer3DCityDB.prototype.triggerEvent = function (event, object) {
248+
// get Object id from object
249+
if (event == "CLICK") {
250+
this._clickEvent.raiseEvent(objectId);
251+
} else if (event == "MOUSEIN") {
252+
this._mouseInEvent.raiseEvent(objectId);
253+
} else if (event == "MOUSEOUT") {
254+
this._mouseOutEvent.raiseEvent(objectId);
255+
}
256+
}
257+
258+
259+
260+
261+
262+
263+
264+
265+
266+
267+
268+
269+
270+
271+
272+
273+
274+
275+
276+
277+
278+
279+
280+
281+
282+

0 commit comments

Comments
 (0)