0

In my Wire Cloud mashup I want to use two different maps, each maps get data from a different operator and each operator consult a different instance of ORION context broker.

When I put this two operators and the two maps in differents workspaces, this components work fine. If I put all this components in the same mashup and the same tab, also works fine. In this two cases, I recieve the data from the context broker, the operator send this data adapted for the map and this one represent the data perfectly.

My problem occurs when I put these operators and maps in the same mashup but in different tab each one. In this case i always obtain the following error:

Exception catched while processing an event that reached the "notiCAM" input endpoint       fdcae15cbdc8.js:775
log                 fdcae15cbdc8.js:775
propagate           fdcae15cbdc8.js:853
_notifyLoaded       fdcae15cbdc8.js:744

After many hours trying to fix this case, I can´t find why this maps and operators does not work in this third case, is someone in this same situation? which solution worked in your case?

thanks

P.D: For my maps im using google maps API

Mest
  • 99
  • 2
  • 6

1 Answers1

0

I'm assuming you're not using the "Map Viewer" widget available on the FI-LAB store.

The problem seems to be related to the way your map widget handles incoming events. Take into account that:

  • Widgets are loaded when the tab where they are located is displayed or when a first event arrives on any of their input endpoints
  • Any event arriving on an input endpoint of an unloaded widget/operator gets queued until that widget/operator is fully loaded
  • WireCloud assumes widget/operators are fully loaded by capturing the "load" event of their iframe

The Google Map API is usually loaded asynchronously, making your widget unable to manage those incoming events until that API get ready (some time after the load event).

Currently, the only viable solution is to buffer events arriving on the "notiCAM" endpoint after the load event but before the google maps api is loaded, handling them just when that api notifies you that it's ready.

Álvaro Arranz
  • 2,015
  • 1
  • 13
  • 22