File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
sdkproject/Assets/Mapbox/Unity/Map Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -250,6 +250,15 @@ public virtual Vector3 GeoToWorldPosition(Vector2d latitudeLongitude)
250
250
return _root . TransformPoint ( Conversions . GeoToWorldPosition ( latitudeLongitude , CenterMercator , WorldRelativeScale ) . ToVector3xz ( ) ) ;
251
251
}
252
252
253
+ public virtual float QueryHeightData ( Vector2d latlong )
254
+ {
255
+ var _meters = Conversions . LatLonToMeters ( latlong . x , latlong . y ) ;
256
+ var tile = MapVisualizer . ActiveTiles [ Conversions . LatitudeLongitudeToTileId ( latlong . x , latlong . y , ( int ) Zoom ) ] ;
257
+ var _rect = tile . Rect ;
258
+ var _worldPos = GeoToWorldPosition ( new Vector2d ( latlong . x , latlong . y ) ) ;
259
+ return tile . QueryHeightData ( ( float ) ( ( _meters - _rect . Min ) . x / _rect . Size . x ) , ( float ) ( ( _meters . y - _rect . Max . y ) / _rect . Size . y ) ) ;
260
+ }
261
+
253
262
public abstract void Initialize ( Vector2d latLon , int zoom ) ;
254
263
255
264
public void Reset ( )
You can’t perform that action at this time.
0 commit comments