简体   繁体   English

铯javascript czml库

[英]cesium javascript czml library

I'm trying to adapt a CZML example for my purpose. 我正在尝试为我的目的改编CZML示例。 I start running it on my local machine after changing all the requirements but it is not running. 更改所有要求后,我开始在本地计算机上运行它,但是它没有运行。

Only part of it is running, for example when I'm using czml for a label then it is running. 它只有一部分正在运行,例如,当我使用czml作为标签时,它正在运行。 Here is the code of that 这是那个的代码

{
    "id":"/Application/STK/Scenario/simple/Facility/AGI",
    "label":{
        "fillColor":{
            "rgba":[
                0,255,255,255
            ]
        },
        "font":"10pt Lucida Console",
        "horizontalOrigin":"LEFT",
        "outlineColor":{
            "rgba":[
                0,0,0,255
            ]
        },
        "pixelOffset":{
            "cartesian2":[
                12.0,0.0
            ]
        },
        "scale":1.0,
        "show":true,
        "style":"FILL",
        "text":"AGI",
        "verticalOrigin":"CENTER"
    },
    "position":{
        "cartesian":[
            1216469.9357990976,-4736121.71856379,4081386.8856866374
        ]
    }
}

But I also want to show an image at the same place, then it is not running and also not giving any error code. 但是我也想在同一位置显示一个图像,然后它没有运行并且也没有给出任何错误代码。 Here is the code for that: 这是该代码:

{
    "id":"Headquarters",
    "availability" : "2013-11-08T09:00:00Z/2013-11-09T17:04:54.9962195740191Z",
    "billboard":{
        "color":{
            "rgba":[
                0,255,255,255
            ]
        },
        "horizontalOrigin":"LEFT",
        "image":"localhost//Cesium-b19/Apps/Sandcastle/images/DownArrow.png",
        "scale":1.0,
        "show":true,
        "verticalOrigin":"CENTER"
    }, 
    "position":{
        "epoch" : "2013-11-08T09:00:00Z",
        "cartesian":[
            1216469.9357990976,-4736121.71856379,4081386.8856866374
        ]
    }
}

What is happening with my code? 我的代码怎么了?

The URL you are using for the "image" property is not correct. 您用于“图片”属性的网址不正确。 It's being interpreted as a relative URL because you are missing the "http://" prefix. 它被解释为相对URL,因为您缺少“ http://”前缀。

The image displays correctly after replacing the "image" property with: 在将“ image”属性替换为以下内容后,该图像可以正确显示:

"image":"http://cesiumjs.org/images/Cesium_Logo.png",

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM