on 07-22-2014 7:00 AM
Hi guys,
I'm using visual sap.ui.vbm.VBI.
I'm just trying to visualize a train on a map:
config.json file:
{
"SAPVB": {
"version": "2.0",
"Config": {
"Set": {
"P": [{
"name": "traceAllowed",
"value": ""
}, {
"name": "language",
"value": "EN"
}]
}
},
"Windows": {
"Set": {
"Window": {
"id": "Main",
"caption": "MainWindow",
"type": "geo",
"refParent": "",
"refScene": "MainScene",
"modal": "true"
}
}
},
"Scenes": {
"Set": {
"SceneGeo": {
"id": "MainScene",
"refMapLayerStack": "DEFAULT",
"initialZoom": "7.5",
"initialStartPosition": "144.542248;-20.332721;0",
"VO": [{
"id": "Spot",
"type": "{00100000-2012-0004-B001-64592B8DB964}",
"datasource": "Spots",
"pos.bind": "Spots.GeoPosition"
}]
}
}
},
"MapLayerStacks": {
"Set": {
"MapLayerStack": {
"name": "DEFAULT",
"MapLayer": {
"name": "MAPQUEST",
"refMapProvider": "MAPQUEST",
"opacity": "1.0E0",
"colBkgnd": "RGB(255,255,255)"
}
}
}
},
"MapProviders": {
"Set": {
"MapProvider": {
"name": "MAPQUEST",
"tileX": "256",
"tileY": "256",
"maxLOD": "19",
"copyright": "Tiles Courtesy of MapQuest © OpenStreetMap under ODbL v1.0 ",
"Source": [{
"id": "s1",
"url": "http://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer/tile/{LOD}/{Y}/{X}"
}]
}
}
},
"DataTypes:": {
"Set": {
"N": [{
"name": "Spots",
"key": "Key",
"A": [{
"changeable": "true",
"name": "Key",
"alias": "K",
"type": "string"
}, {
"changeable": "true",
"name": "GeoPosition",
"alias": "P",
"type": "vector"
}]
}]
}
},
"Data": {
"Set": {
"N": [{
"name": "Spots",
"E": [{
"VB:c": "true",
"P": "146.828570;-19.260971;0",
"K": "t1=="
}]
}]
}
}
}
}
my controller:
onInit: function() { | ||
var that = this; |
this.map = sap.ui.getCore().byId('map'); | |||
$.getJSON("model/config.json", function(conf) { | |||
that.map.load(conf); | |||
}); | |||
} |
I don't know what's going wrong. Can anyone help?
Hello Aaron,
I checked your code, and found out, that there is a small typo in line 71:
"DataTypes:": {
The double collon within the string has to be removed, then your example worked. At least I was able to see a map in our test environment.
I guess there is room for improvement in respect to the error messages, which were hardly useful in this case. We may take a look.
Best regards, Juergen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
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.