Coder Social home page Coder Social logo

cesiumexp-prompt's Introduction

Cesium气泡窗插件

gitee:https://gitee.com/caozl1132/CesiumExp-prompt
github:https://github.com/gitgitczl/CesiumExp-prompt


ps:如果可以的话,希望大家能给我个star,好让我有更新下去的动力;


实现原理: Cesium和我们平时常见的leaflet、ol以及arcgis api是不一样的,其没有内置的气泡窗,那么就得靠我们手写气泡窗来实现了。 本插件样式是参考了leaflet来写的。 气泡窗目前分两种:

  • 1、固定位置气泡窗,即气泡窗的位置固定在地图的某一个点上,不会随鼠标移动。
  • 2、可移动气泡窗,通过给定像素坐标和三维世界坐标来进行气泡窗坐标的设置。 主要的点就是做了:像素坐标和三维世界坐标的相互转换。

两种调用方法:
1、固定位置气泡窗:

prompt1 = new Prompt(viewer, {
    type: 2,
    content: "我是定点提示框",
    position: [117, 32, 100], // 支持多种形式传参 cartesian3 || array || object
    close: function () {
      alert("easy3d--三维可视化类库!");
      return false
    } // 点击关闭按钮的回调函数
  });

2、鼠标移动气泡窗:

  movePrompt = new Prompt(viewer, {
    type: 1,
    content: "我是移动提示框"
  })
    // 设定鼠标位置
   movePrompt.update({
      x: evt.clientX,
      y: evt.clientY
    })

其它:
qq群:606645466(GIS之家共享交流群)

更多案例地址    更多免费数据    开发文档说明

其它源码下载(标绘、量算、动态材质、漫游、地图分析等)

cesiumexp-prompt's People

Contributors

gitgitczl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.