new vcs.vcm.Framework()
Members
-
isIE11{boolean}
-
Whether this is IE11 or not
Methods
-
vcs.vcm.Framework.activateLogging()
-
activates the logging window.
- Deprecated
- Yes
-
vcs.vcm.Framework.dispose()
-
disposes of the Framework
-
vcs.vcm.Framework.getInstance(){vcs.vcm.Framework}
-
Singleton getter for this class
-
vcs.vcm.Framework.getObjectFromOptions(options){Object}
-
returns a constructor of a type.
Name Type Description optionsObject -
vcs.vcm.Framework.getVersion(){string}
-
returns the version of the framework
-
vcs.vcm.Framework.init(config)
-
evaluates the returned config Object creates maps, layers, widgets, and viewpoint objects
Name Type Description configObject Object literal with the following parameters
- mapcontainer:
stringdom id of the mapcontainer - startViewPoint:
stringname of the viewpoint to start the map with. The associated viewpoint must be defined under "viewpoints" - projection :
Objectthe default projection to use for display/input of coordinates to/from the user. Seevcs.vcm.util.Projection - selectBehavior :
ObjectDefines the select behavior for buildings, vectors etc. Seevcs.vcm.SelectBehavior - widgets:
Array(Object)Each object literals defines onevcs.vcm.widgets.Widgetconfiguration. - maps:
Array(Object)Each object literal represents onevcs.vcm.maps.Mapconfiguration - layers:
Array(Object)Each object literal in the array consists of onevcs.vcm.layer.Layerconfiguration - viewpoints:
Array(Object)Each object literal in the array consists of onevcs.vcm.util.ViewPointconfiguration - availableLocales
Array(string)The available locales in the map. If one or omitted, no language selection is available in the map - locale:
stringlanguage token (de, en, pl, nl), determines the default language - ui:
Objectui Configuration for UI part, see example Configuration file for - i18n:
ObjectCan be used to overwrite existing i18n entries or add new ones which can be used for example in a balloon.
For example: to include a translation in a balloon for the word "building" use
If now a balloon is defined with a template which includes:"i18n" : { "en" : { "i18n_building" : "Building" }, "de" : { "i18n_building" : "Gebauede" } }
The innerText of this element will be filled with the appropriate translation. Make sure to the classname always starts with "i18n_" To overwrite existing translations, check which i18n_.. class is attached to the element and overwrite.<div class="i18n_building"> </div>
- mapcontainer:
-
vcs.vcm.Framework.loadConfig(url)
-
starts the framework from an external config.json file. After ajax loading the config file "init" is called with the loaded data.
Name Type Description urlstring the url of the config json file
-
activateMap(name, optViewpoint)
-
Deactivates the current active map, and activates the map with the given name. The new map uses the current viewpoint of the currently active map or -if specified- uses the opt_viewpoint
Name Type Description namestring optViewpointvcs.vcm.util.ViewPoint optional starting Viewpoint
-
addFlight(flight)
-
Name Type Description flightvcs.vcm.util.flight.FlightInstance -
addLayer(layer){boolean}
-
add Layer to the Framework
Name Type Description layervcs.vcm.layer.Layer Returns:
returns true if the layer has been added, false otherwise, check the logs for the cause
-
addMap(map){boolean}
-
adds a map to the framework. If the startingmap config value is set to true the activate function of the map is called.
Name Type Description mapvcs.vcm.maps.Map Returns:
true/false if the map has been added.
-
addStyle(style)
-
adds a style to the framework
Name Type Description stylevcs.vcm.util.style.StyleItem -
addViewPoint(viewpoint)
-
returns the viewpoints as an array
Name Type Description viewpointvcs.vcm.util.ViewPoint -
addWidget(widget){boolean}
-
adds a widget to the framework.
Name Type Description widgetvcs.vcm.widgets.Widget Returns:
returns true if the widget has been added, otherwise false;
-
dispose()
-
destroys the framework instance framework
-
getActiveMap(){vcs.vcm.maps.Map}
-
returns the currently active Map
-
getConfig(path){Object}
-
returns the config
Name Type Description pathstring the config path to checkout, use dots for nested keys ( if not given, the whole config is returned)
-
getFlightByName(name){vcs.vcm.util.flight.FlightInstance}
-
Name Type Description namestring -
getFlights(){Array.<vcs.vcm.util.flight.FlightInstance>}
-
-
getI18nConfig(){Object}
-
returns the i18n information
-
getLayerByName(name){vcs.vcm.layer.Layer}
-
returns the layer with the given name
Name Type Description namestring layer name
-
getLayers(){Array.<vcs.vcm.layer.Layer>}
-
returns all Layer
Returns:
layers
-
getLocale(){string}
-
returns the current locale
Returns:
the current locale
-
getLocales(){Array.<string>}
-
returns possible locales
Returns:
the current locale
-
getMapByName(name){vcs.vcm.maps.Map}
-
returns a map
Name Type Description namestring -
getMapByType(className){vcs.vcm.maps.Map}
-
returns a map based on the given type
Name Type Description classNamestring -
getMapContainer(){HTMLElement}
-
returns the Mapcontainer, here the different maps add themselves as children.
-
getMaps(){Array.<vcs.vcm.maps.Map>}
-
returns an array of maps in the framework
-
getProjection(){vcs.vcm.util.Projection}
-
returns the projection
-
getSelectBehavior(){vcs.vcm.SelectBehavior}
-
returns the selectBehavior, if no selectBehavior returns null
-
getStartViewPoint(){vcs.vcm.util.ViewPoint}
-
returns the starting viewpoint or null if none is set
-
getStyleByName(name){vcs.vcm.util.style.StyleItem}
-
Returns the given style
Name Type Description namestring -
getViewPointByName(name){vcs.vcm.util.ViewPoint}
-
returns the viewpoint with the given name
Name Type Description namestring the viewpoint name
-
getViewPoints(){Array.<vcs.vcm.util.ViewPoint>}
-
returns the viewpoints as an array
-
getWidgetByName(name){vcs.vcm.widgets.Widget|null}
-
returns a Widget with the given name
Name Type Description namestring widget Name
- Deprecated
- Yes
-
getWidgetByType(type){vcs.vcm.widgets.Widget|undefined}
-
returns the first widget with the given type
Name Type Description typestring the type of the widget
-
getWidgets(){Array.<vcs.vcm.widgets.Widget>}
-
returns all widgets
-
getWidgetsByType(type){Array.<vcs.vcm.widgets.Widget>}
-
returns an array of Widgets with the given type
Name Type Description typestring widget type
-
isInitialized(){boolean}
-
returns if the framework has been initialized;
-
isMobile(){boolean}
-
returns true if we are on a mobile device including tablets
-
loadLibraries(sources, dontuseBasePath){Promise}
-
can be used to load one or more additional external libraries. Returns a Promise if all library are loaded.
framework.loadLibraries(["jquery.js"]).then(function(){ use jquery... });
Name Type Description sourcesArray.<string> dontuseBasePathboolean -
publish(topic, opt_data)
-
Publishes a message to a topic. Calls functions subscribed to the topic in the order in which they were added, passing all arguments along.
Name Type Description topicstring | vcs.vcm.event.EventType Topic to publish to.
dataany Arguments that are applied to each subscription function.
-
removeLayerByName(name)
-
remove Layer from Framework and calls dispose on layer
Name Type Description namestring -
setLocale(lang)
-
sets the current locale
Name Type Description langstring -
setProjection(projection)
-
sets the projection
Name Type Description projectionvcs.vcm.util.Projection -
setStartViewPoint(viewpoint)
-
sets the startview for automatically loading maps, has to be set before map activation
Name Type Description viewpointvcs.vcm.util.ViewPoint -
subscribe(topic, handler, optContext){number}
-
Subscribes a function to a topic
Name Type Description topicstring | vcs.vcm.event.EventType Topic to subscribe to.
handlerfunction Function to be invoked when a message is published to the given topic.
optContextObject Object in whose context the function is to be called (the global scope if none).
Returns:
Subscription key, can be used to unsubscribe
-
subscribeExclusive(topic, handler, id, removed, optContext){number}
-
Subscribes a function to an exclusive topic, deactivating the previous function
Name Type Description topicstring | vcs.vcm.event.EventType Topic to subscribe to.
handlerfunction Function to be invoked when a message is published to the given topic.
idstring a UUID to identify the exclusive caller
removedfunction Function to be invoked when the listener is removed
optContextObject Object in whose context the function is to be called (the global scope if none).
Returns:
Subscription key, can be used to unsubscribe
-
subscribeOnce(topic, handler, optContext){number}
-
Subscribes a single-use function to a topic. The function is only called once and automatically unsubscribed.
Name Type Description topicstring | vcs.vcm.event.EventType Topic to subscribe to.
handlerfunction Function to be invoked once and then unsubscribed when a message is published to the given topic.
optContextObject Object in whose context the function is to be called (the global scope if none).
Returns:
Subscription key, can be used to unsubscribe
-
subscribeOnceExclusive(topic, handler, id, removed, optContext){number}
-
Subscribes a single-use function to an exclusive topic, deactivating the previous function
Name Type Description topicstring | vcs.vcm.event.EventType Topic to subscribe to.
handlerfunction Function to be invoked when a message is published to the given topic.
idstring a UUID to identify the exclusive caller
removedfunction Function to be invoked when the listener is removed
optContextObject Object in whose context the function is to be called (the global scope if none).
Returns:
Subscription key, can be used to unsubscribe
-
unsubscribeByKey(key)
-
Unsubscribes a function from a topic by a key. Only deletes the first match found.
Name Type Description keynumber key to unsubscribe
virtualcityMAP 3.6