Announcement

Collapse
No announcement yet.

Limit Zoom View

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Limit Zoom View

    hi, how can i limit the near zoom and far zoom of the camera?

  • #2
    I'm not sure, as I haven't written any code to do it.

    But, if you haven't solved it already, you might look into limiting the
    navigator.currentState().eyePoint

    And, you might want to check out the DrawContext eyePosition altitude:
    dc.eyePosition.altitude

    Or if you just want to limit a particular layer from being too far zoomed out on or into, you can make the layer only appear within a certain eye altitude range by setting the layer's minActiveAltitude and minActiveAltitude properties.

    var myLayer = new WorldWind.RenderableLayer(); //Creates a renderable layer
    myLayer.displayName = "My Layer"; //Names the layer
    myLayer.minActiveAltitude = 0; // A number specifying the eye altitude above which the layer is displayed. The layer is not displayed if the eye altitude is below this value
    myLayer.maxActiveAltitude = 15000000; //A number specifying the eye altitude below which the layer is displayed. The layer is not displayed if the eye altitude is above this value.

    Comment

    Working...
    X