var oModelInputless = new sap.ui.model.odata.v2.ODataModel("http://server:port/path/Inputless.xsodata",{
json: true,
useBatch: false,
defaultBindingMode: "None"
});
sap.ui.getCore().setModel(oModelInputless, "Inputless");
//set the device model
this.setModel(models.createDeviceModel(), "device");
//instanciation the map in the Component.js but not in the view
sap.ui.getCore().byId("vbi").setModel(oModelInputless, "Inputless");
sap.ui.getCore().byId("vbi").bindAggregation("regions", {
path: "Inputless>/Data",
template: sap.ui.getCore().byId("region"),
parameters: {
select: "dpt,ratio"
}
});
/* Specifies the Controller belonging to this View.
* In the case that it is not implemented, or that "null" is returned, this View does not have a Controller.
* @memberOf controller.main
*/
getControllerName: function() {
return "package.controller.main";
},
/* Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed.
* Since the Controller is given to this method, its event handlers can be attached right away.
* @memberOf controller.main
*/
createContent: function(oController) {
// set the geojson location to some data
jQuery.sap.require("sap.ui.vbm.AnalyticMap");
// Map GeoJSON
sap.ui.vbm.AnalyticMap.GeoJSONURL = "./map/country.json";
//region template
var oRegion = new sap.ui.vbm.Region("region", {
code: "{Inputless>DEPT}",
color: { // fixé en rajoutant data-sap-ui-bindingSyntax="complex" au index.html
parts: ["Inputless>QSperc"],
formatter: oController.formatter.qsColor
},
tooltip: "{Inputless>QSperc}"
});
var oVBI1 = new sap.ui.vbm.AnalyticMap('vbi', {
width: "100%",
height: 1000,
plugin: false,
centerPosition: "2.2137;46.2276",
zoomlevel: 6,
vos: [oSpots]
});
var oPage = new sap.m.Page({
title: "{i18n>title}",
content: [oVBI1]
});
var app = new sap.m.App("myApp", {
initialPage: "oPage"
});
app.addPage(oPage);
return app;
}
});