超图js版本矢量图层加载点要素单击弹出信息框

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="point1.aspx.cs" Inherits="point_point1" %>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>点</title>
<style type="text/css">
body{
margin: 0;
overflow: hidden;
background: #fff;
}
#map{
position: relative;
height: 553px;
border:1px solid #3473b7;
}
</style>
<link href='../css/bootstrap.min.css' rel='stylesheet' />
<link href='../css/bootstrap-responsive.min.css' rel='stylesheet' />
<script src = '../libs/SuperMap.Include.js'></script>
<script type="text/javascript">
var map, layer, vector,
host = "http://localhost:8090";
url = host + "/iserver/services/map-china400/rest/maps/China";
function init(){
//初始化地图
map = new SuperMap.Map("map",{controls:[
new SuperMap.Control.Navigation() ,
new SuperMap.Control.Zoom()
]});
map.addControl(new SuperMap.Control.MousePosition());
//初始化图层
layer = new SuperMap.Layer.TiledDynamicRESTLayer("China", url, null,{maxResolution:"auto"});
//监听图层信息加载完成事件
layer.events.on({ "layerInitialized": addLayer });

vector = new SuperMap.Layer.Vector("vector层");
var callbacks = {
    click: function (currentFeature) {
        closeInfoWin();
        var popup = new SuperMap.Popup.FramedCloud("popwin",
        new SuperMap.LonLat(0, 0),
        null,
        "鼠标点击测试点Demo! ",
        null,
        true);
        infowin = popup;
        map.addPopup(popup);
    }
};
var selectFeature = new SuperMap.Control.SelectFeature(vector,
{
    callbacks: callbacks
});
map.addControl(selectFeature);
selectFeature.activate();
}
//异步加载图层
function addLayer(){
    map.addLayer(layer);    
    map.addLayer(vector);
    map.setCenter(new SuperMap.LonLat(0, 0), 1);
    addPoint();
}

function addPoint() {
    vector.removeAllFeatures();
    //点对象
    var point = new SuperMap.Geometry.Point(0, 0);
    var pointVector = new SuperMap.Feature.Vector(point);
    pointVector.style = {
        fillColor: "green",
        strokeColor: "yellow",
        pointRadius: 10
    };
    vector.addFeatures([pointVector]);
}

var infowin = null;
function closeInfoWin() {
    if (infowin) {
        try {
            infowin.hide();
            infowin.destroy();
        }
        catch (e) { }
    }
}
</script>
</head>
<body onLoad = "init()">
<div id = "map"></div>
</body>
</html>

var callbacks定义回调函数;
SuperMap.Popup.FramedCloud,弹出信息框类;

var selectFeature = new SuperMap.Control.SelectFeature(vector,
{
    callbacks: callbacks
});
把能用鼠标选择的图层添加进要素选择控件的选择列表;
SuperMap.Control.SelectFeature,超图js要素选择控件;

map.addControl(selectFeature);
selectFeature.activate();
把要素选择控件添加到map;激活要素选择控件;

closeInfoWin()是为了点击时关闭前一个弹出框,再打开新的;

 

在此例子基础上进行;

https://blog.csdn.net/bcbobo21cn/article/details/89085909

iServer服务要先启动;否则地图不会出来;

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
s3m层时,地表不平可能是由于以下几个原因造成的。 首先,地表不平可能是由于数据源的问题导致的。S3M层是通过软件的,而数据源可以是各种各样的地理数据,如卫星影像、遥感数据、地形模型等。如果数据源本身就存在地表不平的情况,那么到S3M层中自然也会现地表不平的现象。 其次,地表不平可能是由于层的设置问题引起的。在S3M层时,可以设置层的高程、纹理、光照等属性。如果设置不合理,比如高程数据不准确、纹理贴不匹配、光照效果不适合等,都会导致地表不平的现象现。 另外,地表不平也可能是由于软件本身的算法问题导致的。软件在处理地理数据时,会使用各种算法进行数据处理和渲染。如果算法不够精确或不适用于特定地区的地理环境,也会现地表不平的情况。 针对地表不平的问题,可以尝试以下解决方法。首先,检查数据源的质量和准确性,确保数据本身没有问题。其次,调整层的属性设置,比如重新设置高程、纹理、光照等参数,使其与实际地表相匹配。最后,如果问题仍然存在,可以尝试更新或升级软件,以获取更好的算法支持和优化。 总之,s3m层地表不平的原因多种多样,需要综合考虑数据源、层设置和软件算法等方面的问题来进行分析和解决。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值