使用产品:iclient8c 操作系统:win7 x64
TiledDynamicRESTLayer设置剪面clipRegion属性无效
//绘制多边形获得多边形Geometry
handlerPolygon.drawEvt.addEventListener(function(result){
tooltip.setVisible(false);
handlerPolygon.polygon.show = false;
handlerPolygon.polyline.show = false;
for(var a = 0;a<result.object.positions.length;a++){
var position = result.object.positions[a];
var longitude = position.y;
var latitude = position.z;
var queryPoint = {
x: longitude,
y: latitude
};
points.push(new SuperMap.Geometry.Point(queryPoint.x,queryPoint.y));
}
var linearRings = new SuperMap.Geometry.LinearRing(points);
var region = new SuperMap.Geometry.Polygon([linearRings]);
fanwei = region;
})
//加载图层
function GetMap() {
map = new SuperMap.Map("map", {
controls: [
new SuperMap.Control.Navigation(),
new SuperMap.Control.Zoom()]
});
layerMain = new SuperMap.Layer.TiledDynamicRESTLayer("yx", url,
{clipRegion:fanwei,clipRegionEnabled:true})
layerMain.events.on({ "layerInitialized": addLayer });
vector = new SuperMap.Layer.Vector("vector");
addData();
}
function addLayer() {
map.addLayers([layerMain, vector]);
map.setCenter(new SuperMap.LonLat(mapSettingObj.birdEye.x,mapSettingObj.birdEye.y),4);
}