2

好吧,我正在尝试显示以下实体:

{
  "contextResponses" : [
    {
      "contextElement" : {
        "type" : "City",
        "isPattern" : "false",
        "id" : "Miraflores",
        "attributes" : [
          {
            "name" : "position",
            "type" : "coords",
            "value" : "-12.119816, -77.028916",
            "metadatas" : [
              {
                "name" : "location",
                "type" : "string",
                "value" : "WSG84"
              }
            ]
          }
        ]
      },
      "statusCode" : {
        "code" : "200",
        "reasonPhrase" : "OK"
      }
    }
  ]
}

使用 MapViewer 小部件(插入/更新 PoI)将 NGSI 源和 NGSI 实体连接到 Poi 操作员,并具有以下设置:

NGSI 来源

NGSI 实体到 Poi

  • 坐标属性:位置

但是地图上什么也没有!有人可以帮我找出问题所在吗?

4

2 回答 2

1

似乎您的配置是正确的(我假设 mydirection:1026 是一个完整的 URL,即包含协议),但可能您的网络正在过滤端口 3000。尝试http://ngsiproxy.lab.fi-ware.org用作 NGSI 代理而不是http://mashup.lab.fi-ware.org:3000/.

实际上,我建议您在上下文代理实例中启用 https 通知https://ngsiproxy.lab.fi-ware.org并改为使用,尤其是当您在 https 网页(例如https://mashup.lab.fi-ware.org)中创建 WireCloud 仪表板时使用此NGSI 代理将解决一些混合内容问题,请参阅:

更新:FIWARE 已从 fi-ware.org 迁移到 fiware.org。推荐的 NGSI 代理服务器现在ngsiproxy.lab.fiware.orgngsiproxy.lab.fi-ware.org仍然有效)。

于 2014-11-25T16:35:17.477 回答
1

在Fiware上启动 MapViewer 的三个简单步骤:

  1. 更新系统中的Orion ContextBroker

  2. 您应该检查守护进程rushrdis是否已安装并在您的系统中运行

  3. 您应该在init.d中创建正确的引导顺序:redisrushcontextBroker

在这些步骤之后,您可以使用MapViewerNGSI 源NGSI 实体到 POI在Wirecloud中构建您的查看界面。

您必须正确使用结构化 JSON 消息,如下例所示:

{ "contextElements": 
 [
    {
        "type": "iotdevice","isPattern": "false","id": "edison1", "attributes": 
        [
            {
                "name": "temperature",
                "type": "string",
                "value": "10"
            },
            {
            "name" : "position",
            "type" : "coords",
            "value" : "-20, 35",
            "metadatas" : [
              {
                "name" : "location",
                "type" : "string",
                "value" : "WSG84"
              }
         ]
         }
]
}
],

   "updateAction": "APPEND"
}
于 2015-12-22T12:06:58.850 回答