GPS coordinates
For creating small scale digital twins of buildings or assets you can specify the transformations of items as x-, y- and z-coordinates. If you have a large scale digital twin, such as a campus, city of country, it is more convenient to work with GPS coordinates. You can mix and match XYZ-, and GPS coordinates in a single model. For example, to position an asset in a building you can use the XYZ-coordinates and for positioning the building on a map you can enter the GPS-coordinates.
A GPS coordinate has a latitude, longitude and altitude. Latitude and longitude are defined in decimal degrees, similarly to Google maps and other products. The altitude is defined in meters above the surface of the earth. The GPS location of an item can be specified by the position
topic.
GPS location
This example shows how to place 3D buildings on a map. To display a map, create a new model, click on View
and enter the latitude and longitude of the center of the map in the Map
field. In the example below some offices and parking buildings are positioned on a map. You can find the position by clicking in Google Maps and copy the coordinates. The orientation
topic specifies the rotation of the object along the z-axis. An orientation of 180
means that the object is aligned to the south. In this example the geometry is specified by a JavaScript function block(x, z, z)
, but you can also enter the name of a solid script or an uploaded GTLF model.
htc.parking.p1.orientation = 17
htc.parking.p1.position = 51.412549786755015, 5.454481803707153, 0
htc.parking.p1.geometry = block(61,32,50)
htc.parking.p1.name = P1
htc.parking.p1.type = parking
htc.parking.p2.orientation = 17
htc.parking.p2.position = 51.41277531843427, 5.455779596874186, 0
htc.parking.p2.geometry = block(61,32,50)
htc.parking.p2.name = P2
htc.parking.p2.type = parking
Zooming and panning
If a map is loaded the standard orbit controls for rotating the view are replaced by a map control. You can use a mouse or trackpad to zoom and rotate. When the viewpoint has changed the map tiles are reloaded at a different zoom level.