我正在使用以下函数在 Telerik appbuilder 中使用剑道 ui 显示地图。如您所见,我为此分配了静态纬度和经度。请提出一些使用剑道 ui 获取纬度的方法。我想将纬度和经度值传递给 createMap(x,y) 函数。
function createMap(x,y) {
console.log("createmap");
// console.log("x=" + x + " " + "y=" + y);
var ds = [
{ "shape": "green", "location": [30.667936 ,76.732688] },
];
// 30.710458600000000000 30.657762
// 76.703347099999970000 76.740835
$("#map, #addAddFav").kendoMap({
center: [30.667936, 76.732688],
zoom: 10,
layers: [{
type: "tile",
urlTemplate: "http://#= subdomain #.tile2.opencyclemap.org/transport/#= zoom #/#= x #/#= y #.png",
subdomains: ["a", "b", "c"],
attribution: "© <a href='http://osm.org/copyright'>OpenStreetMap contributors</a>." +
"Tiles courtesy of <a href='http://www.opencyclemap.org/'>Andy Allan</a>"
},
{
type: "marker",
/* dataSource: {
transport: {
read: {
url: "map/store-locations.json",
dataType: "json"
}
}
},*/
// locationField: "latlng",
// titleField: "name"
}
],
markers: ds,
click: onMapMarkerClick,
shapeClick: onShapeClick,
shapeCreated: onShapeCreated
});
}