提交
This commit is contained in:
@ -126,12 +126,7 @@ class PolyhedronObject extends Base {
|
|||||||
positions[0].push([that.options.positions[0].lng, that.options.positions[0].lat])
|
positions[0].push([that.options.positions[0].lng, that.options.positions[0].lat])
|
||||||
let polygon = turf.polygon(positions);
|
let polygon = turf.polygon(positions);
|
||||||
let centroid = turf.pointOnFeature(polygon);
|
let centroid = turf.pointOnFeature(polygon);
|
||||||
if (!that.options.label.position) {
|
that.options.label.position = { lng: centroid.geometry.coordinates[0], lat: centroid.geometry.coordinates[1], alt: that.options.extrudedHeight + that.options.height }
|
||||||
that.options.label.position = { lng: centroid.geometry.coordinates[0], lat: centroid.geometry.coordinates[1], alt: that.options.extrudedHeight + that.options.height }
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
that.options.label.position.alt = that.options.extrudedHeight + that.options.height
|
|
||||||
}
|
|
||||||
// 标签
|
// 标签
|
||||||
that.label = new LabelObject(that.sdk, {
|
that.label = new LabelObject(that.sdk, {
|
||||||
id: that.options.id,
|
id: that.options.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user