Browse Source

111

shibei_master
jiangyy 3 years ago
parent
commit
a7d5814114
  1. 17
      src/views/modules/visual/basicinfo/basicInfoMain.vue

17
src/views/modules/visual/basicinfo/basicInfoMain.vue

@ -172,6 +172,8 @@ let iconSource; // icon
let polygonSource;//
let select;//
let xoffset = 0.005
//url
@ -629,10 +631,12 @@ const vueGis = {
let polygonArray = []//[[lon,lat],[lon,lat],[lon,lat]]
coorArray.forEach((item, index) => {
itemArray.push(item)
if (index % 2 == 0) {//
if (index % 2 == 0) {//
// item = (parseFloat(item) + xoffset) + ''
itemArray.push(item)
} else {//
itemArray.push(item)
polygonArray.push(itemArray)
itemArray = []
}
@ -694,10 +698,15 @@ const vueGis = {
let polygonArray = []//[[lon,lat],[lon,lat],[lon,lat]]
coorArray.forEach((item, index) => {
itemArray.push(item)
// itemArray.push(item)
if (index % 2 == 0) {//
// item = (parseFloat(item) + xoffset) + ''
itemArray.push(item)
} else {//
itemArray.push(item)
polygonArray.push(itemArray)
itemArray = []
}
@ -715,7 +724,7 @@ const vueGis = {
'features': featureData
};
let feature = (new GeoJSON()).readFeatures(geojsonObject)
console.log(geojsonObject)
polygonSource.addFeatures(feature)

Loading…
Cancel
Save