Hello,
I am trying to set marks on a marker layer via JSON returned from my MVC controller. I am capturing an onCriteriaChange event from a ListView. In the event handler function I am try the following
My declaration code is
so you can see the layer already exists. I just want to set a marker for the lat, long returned by my controller.
I can verify that my controller is producing JSON (see attached screenshot). But the markers do not show. Am I doing this correctly? Any help would be appreciated.
I am trying to set marks on a marker layer via JSON returned from my MVC controller. I am capturing an onCriteriaChange event from a ListView. In the event handler function I am try the following
var mapData = $('#map').data('kendoMap'); mapData.layers[1].dataSource = new kendo.data.DataSource({ transport: { read: { url: ('@Url.Action("getMapData")'), dataType: "json", data: { customerId: customer.Id } } } }); mapData.layers[1].dataSource.read();My declaration code is
$("#map").kendoMap({ center: [30.268107, -97.744821], zoom: 15, 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", locationField: "latlng", titleField: "name", }] });so you can see the layer already exists. I just want to set a marker for the lat, long returned by my controller.
I can verify that my controller is producing JSON (see attached screenshot). But the markers do not show. Am I doing this correctly? Any help would be appreciated.