Lumira Geo Maps Extension with Custom Regions/Shapes and Data Points
After creating my first spatial extension with google maps, I realised that cost of google maps api for commercial use may be an obstacle for productive use. Then I decided to create a second extension with leaflet.js library. There are several reasons behind selecting leaflet; it is mobile friendly, easy to use, flexible and has lots of features. I created below extension as the first version, I guess there are still several bugs that I didnt realize. I will be fixing bugs and adding new features if I can find time.
This first version of extension has below abilities;
Custom Regions/Shapes With Geojson Files
This is what my customers has always requested. Usually people want to have their own region definitions which is sometimes different than regular city or region shapes. Standart Lumira maps has this kind of fixed region definitions but, sometimes it doesnt include shapes for small cities.
This is where geojson works great. Geojson is a spatial json format which stores polygons, lines and points. It is easy to create geojson files from existing shape files. There are a lot of online services for this purpose. I am using mapshaper and geojson.io in order to convert my shape files to geojson. Additionally, you can google to find geojson files as well.
After converting or finding a geojson file you have to insert variable definition “var mapdata =” at the begining of file.
Second important point about geojson is, it has names for shapes. Values of “name” field must correspond to name of regions in your data file.
You have to name your file “geojson.js” and place it under “C:\Users\[YOURUSERNAM]\.sapvi\extensions\bundles\sap\viz\ext\geomapsleaflet” for Lumira 1.25+ and for the previous versions, you can place file under “C:\Program Files\SAP Lumira\Desktop\extensions\bundles\sap\viz\ext\geomapsleaflet”.
With the extension you will get us states geojson, but if you want to use a world map, it is also included.
Circles and Markers
In order to use circles and markers you must have data in latitude and longtitude format. Your field names must start with “lan” and “lon”, remaining letters are neglected. For the shape name, you can use what ever name you want. Extension determines dimension names dynamically.
When you go to layers button, you will see circles and markers selection. You can either select them together or use only one.
Circles are sized and colored according to data. Markers are only showing the place of data, you can click and see related data within a pop-up.
Tile Providers (Basemaps)
One of the best features of leaflet is, it is compatible with lots of tile providers. For my extension, I used only a couple of them to keep selection screen simple. However you can add others as well easily. Full list and demo can be found here.
Color Palettes
Shapes and circles are colored according to your color palette settings under preferences. Thanks David Dalley for his blog about color palettes.
Download Extension
You can download here and try with your own data. Enjoy geo maps extension.
Hi Mustafa,
It looks amazing.
I wonder if the custom region/shapes could work also on Lumira Server?
Thank you Donnie.
I didnt test on lumira server. please let me know if you can try on server.
Hi Mustafa,
I tried installing it on the Lumira Server but it failed. The error message is:
The file uploaded is not a valid extension zip file
I tried comparing this extension to the others made by you too, like mini donut and mini area chart (which can be installed in the Lumira Server successfully).
Within the \bundles\sap\viz\ext\geomapsleaflet\, there are more files than within the corresponding ones within the \bundles\sap\viz\ext\minidonut\.
Maybe the other files should be contained somewhere else, though it's weird since it's working on the Lumira Desktop.
Hi Donnie,
You can download it from GitHub
This version is the latest and is compatible with the latest version of Lumira desktop. It should work on Lumira Server for Teams too.
Hi Mustafa,
This is amazing.
Is it possible to create custom region/shapes in design studio 1.6?
like: if sales region A contains India and Canada can I show it as single region in design studio 1.6?
Regards,
Swagata