How to show an entity from in the Wirecloud MapViewer widget

771 views Asked by At

Well I'm trying to show the following entity:

{
  "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"
      }
    }
  ]
}

Wiring NGSI Source and NGSI Entity to Poi operatiors with MapViewer widget (Insert/Update PoI), with the following settings:

NGSI Source

NGSI Entity to Poi

  • Coordinates attribute: position

But nothing shows up in the map! Can somebody help me figure out what the problem is?

2

There are 2 answers

3
Álvaro Arranz On BEST ANSWER

Seems your configuration is correct (I'm assuming mydirection:1026 is a full URL, i.e. includes the protocol), but probably your network is filtering port 3000. Try to use http://ngsiproxy.lab.fi-ware.org as NGSI proxy instead of http://mashup.lab.fi-ware.org:3000/.

Indeed, I recommend you to enable https notifications in your context broker instance and use https://ngsiproxy.lab.fi-ware.org instead, especially if you are creating your WireCloud dashboard in an https web page (e.g. https://mashup.lab.fi-ware.org) as using this NGSI proxy will solve some mixed content problems, see:

Update: FIWARE has move from fi-ware.org to fiware.org. The recommended NGSI proxy server is now ngsiproxy.lab.fiware.org (ngsiproxy.lab.fi-ware.org still works).

4
Fabio Henrique Cabrini On

Three simple steps to start MapViewer on Fiware:

  1. Update the Orion ContextBroker in your system

  2. You should check if the daemons rush and rdis are installed and running in your system

  3. You should create a correct boot sequence in the init.d: redis, rush and contextBroker

After these steps, you can build your viewing interface in Wirecloud using MapViewer, NGSI source and NGSI entity to POI.

You must use structured JSON messages correctly as in the following example:

{ "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"
}