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) {
              }
          }
      }
  • 相关阅读:
    python:递归函数(汉诺塔)
    python:代码复用与函数递归
    unity接入平台sdk
    原型和原型链
    闭包js
    微信小游戏的排行榜重点
    微信简单的排行榜
    代理服务器出现问题解决方案
    nodejs的fs模块
    nodejs的l分数
  • 原文地址:https://www.cnblogs.com/wanlige/p/13723816.html
Copyright © 2011-2022 走看看