@@ -9,8 +9,6 @@ class MyProvider extends SpaceProvider {
99 detectFeatureClass ( feature ) {
1010 return feature . properties . featureClass ;
1111 }
12-
13-
1412 // ######################## Navlink ########################
1513 // Following functions are only necessary if you want to edit Navlink.
1614
@@ -89,6 +87,53 @@ class MyProvider extends SpaceProvider {
8987 writeZLevels ( navlink , zLevel ) {
9088 navlink . prop ( 'zLevels' , zLevel ) ;
9189 }
90+ // #################### Buildings/Extruded Polygons ####################
91+ // Following functions are only necessary if you want to edit Buildings (Extruded Polygons).
92+
93+ // to obtain the height of a Building the respective attribute reader must be implemented.
94+ readFeatureHeight ( feature ) {
95+ return feature . properties . height ;
96+ }
97+ // the Attribute writer stores the modified height and must be implemented to enable height-editing of the building.
98+ writeFeatureHeight ( feature , heightMeter ) {
99+ feature . properties . height = heightMeter ;
100+ }
101+ // ######################## Address, Place ########################
102+ // Following functions are only necessary if you want to edit Address or Place.
103+
104+ // In addition to a simple Marker, a Place CAN, while an Address MUST have a routing point.
105+ // A routing point of a Place or Address is a geo position (routingPosition) intended for routing purposes and references
106+ // to a navlink (routingLink).
107+ // In this example, we get routingPosition from features's properties 'routingPoint' and routingLink from 'routingLink'.
108+
109+ // Get coordinate of routing point, its format is: [longitude, latitude, altitude].
110+ // This position should always be on the geometry of referenced Navlink.
111+ readRoutingPosition ( feature ) {
112+ return feature . prop ( 'routingPoint' ) ;
113+ }
114+ // Get id of referenced Navlink for Address or Place. Place becomes floating if this function does not return a Navlink id properly.
115+ readRoutingLink ( feature ) {
116+ return feature . prop ( 'routingLink' ) ;
117+ }
118+ // This function is called to write updated coordinate on referenced Navlink when routing position is changed.
119+ // Format of routing position: [longitude, latitude, altitude].
120+ writeRoutingPosition ( feature , position ) {
121+ feature . prop ( 'routingPoint' , position ) ;
122+ }
123+ // This function is called to write new Navlink reference when routingLink is changed.
124+ // For example, drag routing point from one Navlink to another will change routingLink.
125+ // In this example, Navlink id is updated when routingLink changes.
126+ writeRoutingLink ( feature , navlink ) {
127+ feature . prop ( 'routingLink' , navlink ? navlink . id : navlink ) ;
128+ }
129+ // This function is called by editor API to get the provider in which referenced Navlink of Address/Place is located.
130+ // A map/provider setup where all features (Place/Address and referenced Navlink) are provided by the same provider
131+ // (single-provider-setup), this function just needs to return id of the provider itself.
132+ // However, in case of multi-provider-setup, Navlinks can be separated from Address/Place data and distributed across
133+ // multiple providers, this function needs to return id of provider which contains the referenced Navlink.
134+ readRoutingProvider ( location ) {
135+ return this . id ;
136+ }
92137}
93138
94139let backgroundLayer = new MVTLayer ( {
0 commit comments