• 二维气泡弹窗


       // 查找地图所有的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) {
              }
          }
      }
  • 相关阅读:
    常用函数集锦
    HDU1212加深下对取模运算的理解
    HDU1022 queue和vector模拟
    设计模式原则
    3.6html学习笔记之样式选择
    poj 1274(二分图最大匹配)
    poj 1469(二分图最大匹配)
    poj 3692(二分图匹配--最大独立集)
    Codeforces Round #230 (Div. 1) 解题报告
    Codeforces Rockethon 2014 解题报告
  • 原文地址:https://www.cnblogs.com/wanlige/p/13723816.html
Copyright © 2020-2023  润新知