zoukankan      html  css  js  c++  java
  • 二维气泡弹窗

       // 查找地图所有的layers,找到之前的标记,隐藏掉
         var layers = map.layers;
            for (var i = 0; i < layers.length; i++) {
                if (layers[i].name == "markerLayer") {
                    layers[i].setOpacity(0);
                }
            }
            // 关闭二维气泡弹窗
            closeInfoWin();
            // 添加地图marker
            markerlayer = new SuperMap.Layer.Markers("markerLayer");
            var size = new SuperMap.Size(44, 33);
            var offset = new SuperMap.Pixel(-(size.w / 2), -size.h);
            var icon = new SuperMap.Icon('./images/marker.png', size, offset);
            marker = new SuperMap.Marker(new SuperMap.LonLat(point[0], point[1]), icon);
            markerlayer.addMarker(marker);
            map.addLayer(markerlayer);
            // 设置中心点,缩放比例
            map.setCenter(new SuperMap.LonLat(point[0], point[1]), 8);
    
            var lonlat = marker.getLonLat();
            var contentHTML = "<div style='font-size:.8em; opacity: 0.8; overflow-y:hidden;'>";
            contentHTML += "<p>高(毫米) :" + rowData.SSPIPEHEIGHT + "</p></div>";
         var popup = new SuperMap.Popup.FramedCloud("popwin", new SuperMap.LonLat(lonlat.lon, lonlat.lat), null, contentHTML, null, true);
            infowin = popup;
            map.addPopup(popup);     
    // 关闭二维弹出气泡
      function closeInfoWin() {
          if (infowin) {
              try {
                  infowin.hide();
                  infowin.destroy();
              }
              catch (e) {
              }
          }
      }
  • 相关阅读:
    工作
    失败
    理想和一些未来的计划
    安静
    重新开始
    如何度过周末
    放假
    WPF学习笔记-数据采集与监控项目01-登录界面
    VS2017-断点感叹号问题,调试代码显示“当前无法命中断点,还没有为该文档加载任何符号”
    WPF-MVVM模式-表现层的UI框架【学习笔记】
  • 原文地址:https://www.cnblogs.com/wanlige/p/13723816.html
Copyright © 2011-2022 走看看