|
@@ -2329,13 +2329,12 @@
|
|
|
async function ChangeModelColor(name, color, hinttxt) {
|
|
|
var iteminfo = modelsMap[name]
|
|
|
if (iteminfo == null) return
|
|
|
- if(MarkerMap[name]!=null){
|
|
|
- player.Native.GisMarker.destroy(MarkerMap[name]);
|
|
|
- }
|
|
|
//var tmp = await player.Native.ModelTree.findItemByName(name,0,true,3);
|
|
|
if (color == null || color == "") {
|
|
|
//还原
|
|
|
player.Native.ModelTree.restoreItemColor(iteminfo.item)
|
|
|
+ //隐藏已有标签
|
|
|
+ player.Native.GisMarker.update(MarkerMap[name],{"visible":false});
|
|
|
MarkerMap[name]=null;
|
|
|
} else {
|
|
|
player.Native.ModelTree.setItemColor(iteminfo.item, parseInt("0x" + color + "ff"), true)
|
|
@@ -2355,9 +2354,13 @@
|
|
|
//options.parentNode=tmp.item;
|
|
|
options.imgId = imgid
|
|
|
options.imgSize = [-1, -1];
|
|
|
- var markPtr = await player.Native.GisMarker.create(options);
|
|
|
- player.Native.GisMarker.update(markPtr, options);
|
|
|
- MarkerMap[name] = markPtr;
|
|
|
+ if(MarkerMap[name]!=null){
|
|
|
+ player.Native.GisMarker.update(MarkerMap[name],options);
|
|
|
+ }else{
|
|
|
+ var markPtr = await player.Native.GisMarker.create(options);
|
|
|
+ player.Native.GisMarker.update(markPtr, options);
|
|
|
+ MarkerMap[name] = markPtr;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|