合并代码
parent
eb73b3c4eb
commit
8940e0a8f6
|
|
@ -93,12 +93,10 @@
|
|||
let nextMapControl: Array<any> = reactive([]);
|
||||
nextMapControl = props.control
|
||||
? props.control.map((item) => {
|
||||
console.log('item::: ', item);
|
||||
return MapControlConfig[item];
|
||||
})
|
||||
: [];
|
||||
|
||||
console.log('nextMapControl::: ', nextMapControl);
|
||||
|
||||
// 定义地图容器
|
||||
let map: Map;
|
||||
|
|
@ -141,12 +139,10 @@
|
|||
|
||||
// 设置绘图监听事件
|
||||
map.on("draw.create", function (e) {
|
||||
console.log(e);
|
||||
drawGeojson.geojson = e.features[0]
|
||||
});
|
||||
|
||||
map.on("draw.update", function (e) {
|
||||
console.log(e);
|
||||
drawGeojson.geojson = e.features[0]
|
||||
});
|
||||
|
||||
|
|
@ -265,7 +261,6 @@
|
|||
}
|
||||
|
||||
const handlerCopyFeature = () => {
|
||||
console.log("selectFeature",selectFeature);
|
||||
popup.remove();
|
||||
createMessage.success("复制成功!")
|
||||
}
|
||||
|
|
@ -297,7 +292,6 @@
|
|||
|
||||
// 图层控制中心
|
||||
const handlerLayerControler = (layerInfo)=>{
|
||||
console.log("layerinfoinfo",layerInfo)
|
||||
if(map.getSource(layerInfo.layer.id)){
|
||||
if(layerInfo.checked){
|
||||
map.setLayoutProperty(layerInfo.layer.id, "visibility", "visible");
|
||||
|
|
@ -320,7 +314,6 @@
|
|||
// 图斑属性查看
|
||||
const handlerPreviewFeatureInfo = (e) => {
|
||||
if(e.features){
|
||||
console.log("EEEEEEE",e.features[0].layer.id,e.features[0].properties);
|
||||
isOpen.value = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -413,23 +406,32 @@
|
|||
}
|
||||
|
||||
const handlerDraw = (feature=null) =>{
|
||||
let featureTemp = WktToGeojson(feature);
|
||||
console.log("传入的WKT:::",featureTemp);
|
||||
|
||||
|
||||
|
||||
let geo = {
|
||||
type: "FeatureCollection",
|
||||
features: [
|
||||
{
|
||||
"id": "cd1d93c0e4a6747ff597f190c311d0e3",
|
||||
"type": "Feature",
|
||||
"properties": {},
|
||||
"geometry": featureTemp
|
||||
|
||||
let geo = {};
|
||||
|
||||
if(feature==null){
|
||||
geo = {
|
||||
type: "FeatureCollection",
|
||||
features: [],
|
||||
}
|
||||
}else{
|
||||
let featureTemp = WktToGeojson(feature);
|
||||
geo = {
|
||||
type: "FeatureCollection",
|
||||
features: [
|
||||
{
|
||||
"id": "cd1d93c0e4a6747ff597f190c311d0e3",
|
||||
"type": "Feature",
|
||||
"properties": {},
|
||||
"geometry": featureTemp
|
||||
}
|
||||
],
|
||||
}
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
console.log("geo",geo);
|
||||
handlerInitDrawTool(geo)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@
|
|||
|
||||
// 图斑数据
|
||||
// const feature ="LINESTRING (118.55483239594203 35.81329409678203, 118.54889167836416 35.806406839795216, 118.55647247134772 35.80285975465173, 118.56157492816281 35.803303140294986)"
|
||||
const feature = "POLYGON ((118.54774514802972 35.80786133598188, 118.54515277045988 35.79816597053564, 118.55919536113471 35.80085134034624, 118.56021460056033 35.80462789316549, 118.5595188628206 35.80695604583504, 118.5580066425723 35.80815336506183, 118.54774514802972 35.80786133598188))"
|
||||
// const feature = "POLYGON ((118.54774514802972 35.80786133598188, 118.54515277045988 35.79816597053564, 118.55919536113471 35.80085134034624, 118.56021460056033 35.80462789316549, 118.5595188628206 35.80695604583504, 118.5580066425723 35.80815336506183, 118.54774514802972 35.80786133598188))"
|
||||
// 绘图完成返回geom
|
||||
const handlerDrawComplete = (geom)=>{
|
||||
console.log("绘制完成返回的图斑",geom);
|
||||
|
|
@ -84,7 +84,7 @@
|
|||
// 添加图斑
|
||||
// MapboxComponent.value.handlerDraw()
|
||||
// 编辑图斑
|
||||
MapboxComponent.value.handlerDraw(feature)
|
||||
MapboxComponent.value.handlerDraw()
|
||||
},3000)
|
||||
|
||||
// 图斑定位
|
||||
|
|
|
|||
Loading…
Reference in New Issue