on 11-10-2014 9:24 AM
I want to implement this analytic map functionality but i.s stuck in binding the json file data..
As per the development kit sample code it is as given below-
// create some dummy data
var oData =
{
regionProperties :
[
{ "code": "EU", "color": "rgba(184,225,245,1.0)", "tooltip":"Europe\r\n\r\nPopulation: 743 Mio" },
{ "code": "NA", "color": "rgba(5,71,102,1.0)", },
{ "code": "OC", "color": "rgba(0,125,192,1.0)" }
]
};
// create model and set the data
var oModel = new sap.ui.model.json.JSONModel();
oModel.setData( oData );
// set the geojson location to some data
jQuery.sap.require( "sap.ui.vbm.AnalyticMap");
sap.ui.vbm.AnalyticMap.GeoJSONURL = "media/analyticmap/continent.json"; //Someone please tell me about this continent.json// (what should be the json file contents??how to map it to the oData??)
// create analytic map and bind to model
var oVBI = new sap.ui.vbm.AnalyticMap('vbi',
{
width : "100%",
height: 512,
plugin: false,
regions : {
path : "/regionProperties",
template: new sap.ui.vbm.Region( { code: "{code}", color: '{color}', tooltip: '{tooltip}', click: onRegionClick, contextMenu: onRegionContextMenu } )
},
regionClick : onRegionClick,
regionContextMenu : onRegionContextMenu
});
oVBI.setModel( oModel );
oVBI.placeAt("sample1");
we just published how to setup the content.
The binding between the oData and the GeoJSON are the iso-codes defined in the GeoJSON.
You have to use the same iso-codes in your code and in the GeoJSON.
VB maps it then automatically.
Setting up the GeoJSON from your document you can use the country iso codes like FR, IT, DE....
as in the sample code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.