cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a GeoMap extension for Lumira using Mapbox.

Former Member
0 Kudos

I've been trying to create a GeoMap extension for Lumira. The basic idea was to overlay D3 charts (on this instance, pie charts) over the map at specific locations. I've used the Mapbox javascript library for the map. As a simple HTML file, it works fine. It even works on the VizPacker Web IDE. But when I packed the extension, and installed it in Lumira, the map disappeared.

The pie charts appear over a blank "page". The extension is still loading the map's functionality but it just isn't loading the map. The map can be zoomed into and out of, it can be dragged too.

Upon inspecting the Dev Tool, I can see this error.

"XMLHttpRequest cannot load http://a.tiles.mapbox.com/v4/mapbox.streets.json?access_token=pk.eyJ1IjoiYW1pdGd1cHRhMjE2IiwiYSI6ImF.... No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:64882' is therefore not allowed access."

This seems like a Same Origin Policy issue which CORS should be able to solve, BUT the issue is, that the .json file which isn't getting loaded is being called by the mapbox.js file itself. I just mention the map type and access token. So I'm unsure as to how I will be able to implement CORS to work around this issue.

Any help would be highly appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

So here's hoping someone else has the same problem and stumbles upon this thread. This can be worked around by just hardcoding the content of the requested JSON directly into your JavaScript code. It isn't a very clean solution, nor is it a robust one, but it will work!

former_member384109
Participant
0 Kudos

hi yash,

please follow below link.it helping to you.

http://scn.sap.com/community/businessobjects-design-studio/blog/2015/06/09/creating-geojson-maps-for...

regards,

Ankit Patel

Former Member
0 Kudos

Hi Ankit,

That post was helpful but it is for Design Studio, not Lumira.

Regards,

Yash

Answers (0)