Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

154
Visualizações
Offsetting Cesium zoom by pixels

In the UI we have a floating panel occupying the 30% - 40% percent of the screen width and we have a Cesium background map. The mock image below has dots. At the moment we can zoom the view, so that all dots are visible on the screen.

Cesium map with UI control mockup and example points

The logic is simple, we just find the top-left and bottom-right corners of the rectangle that covers all points.

const topLeft = Cartographic.fromDegrees(
  flyTo.minLongitude,
  flyTo.minLatitude,
  0,
)
const bottomRight = Cartographic.fromDegrees(
  flyTo.maxLongitude,
  flyTo.maxLatitude,
  0,
)
const rectangle = Rectangle.fromCartographicArray([topLeft, bottomRight])
viewer.camera.flyTo({
  destination: rectangle,
  duration: flyTo.duration ? flyTo.duration : 0.1,
})

The problem is that the points are under UI controls. We would like to offset the zoom, so that instead of zooming to the center of the screen it would zoom all points to be visible on the right side.

Consider having only a single point. In the current implementation, it would be under the UI controls, but this is what we try to achieve.

Cesium map with point on the right side of the screen

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda