I'm trying to dynamically set the marker color based on a value from a datasource. I can't find any examples of this and can't find an event that fires that would allow me to do this dynamically. Can you point me in the right direction, please. Below is the simple map control that I'm using:
@(Html.Kendo().Map()
.Name("map")
.Center(new double[] { Model.Latitude, Model.Longitude })
.Zoom(17)
.Layers(layers =>
{
layers.Add()
.Type(MapLayerType.Tile)
.UrlTemplate("https://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png")
.Subdomains("a", "b", "c");
layers.Add()
.Type(MapLayerType.Marker)
.DataSource(dataSource => dataSource
.Read(read => read.Action("SelectBillingLocationsCoordinates", "Details", new { Id = @Model.Id }))
)
.LocationField("LatLng")
.TitleField("Name");
})
)
I have a problem displaying the background (mapvision),
i cant see the map, everything else works, like makers, zoom and navigation control
I am implementing the map control like this : https://demos.telerik.com/aspnet-mvc/map
On this site:
https://demos.telerik.com/aspnet-mvc/map/remote-marker
...you get us a nice example of using remote data in a map.
In this provided method you return a json file. How is this structured? I connot find any example.
public
ActionResult _StoreLocations()
{
return
Json(MapDataRepository.StoreLocations());
}
Hi Folks,
i would like to update the markers of a map through signalR. i got it right for a grid control. but in map control, i just get a stack space error and nothing more.
Is it possible, that the map control has no implementation for this scenario, or am i missing something else?
Binding is done as follows:
@(Html.Kendo().Map()
.Name("mapVessels")
.Layers(layers =>
{
layers.Add()
.Type(MapLayerType.Tile)
.UrlTemplate("https://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png")
.Subdomains("a", "b", "c")
.Attribution("© <a href='http://osm.org/copyright'>OpenStreetMap contributors</a>");
layers.Add()
.Type(MapLayerType.Marker)
.DataSource(dataSource => dataSource
.SignalR()
.AutoSync(true)
.Schema(schema => schema
.Model(model =>
{
model.Id("ID");
model.Field("ID", typeof(Guid)).Editable(false);
}))
.Events(events => events.Push("onPush"))
.Transport(tr => tr
.Promise("hubStart")
.Hub("hub")
.Client(c => c
.Read("read"))
.Server(s => s
.Read("read")))
)
.LocationField("LatLng")
.TitleField("Title")
.ValueField("Value")
//.Tooltip(tooltip=>tooltip
// .Content())
;
})
.Center(54.623, 13.2248)
.Zoom(8)
.Events(events => events.MarkerClick("onMarckerClick"))
.Deferred()
)
Hello we are using the map to display different icons for some of our objects and we are using some javascript to set the shape of the marker to the right icon.
Now the customer wants to have more information directly displayed on the map. The best tool to display this data is to incorporate a radial or databar into the icon. is that in any way possible for the map.
Trying to accomplish a simple task, after loading I want to set the map extent based on the marker layer.
I have the code to create the extent and set it but timing is the issue. When I try to do this on document ready the layer item list is empty and there is no explicit "load" event I can attach a handler to. Firing on "reset" will cause infinite recursion since the function is itself changing the viewport of the map plus it seems to fire multiple times.
Basically, I just need to know when this should be called and how to wire a handler to do it at that time.
var map = $('#map').getKendoMap();
var layer = map.layers[1];
var markers = layer.items;
var extent;
for (var i = 0; i < markers.length; i++) {
var loc = markers[i].location();
if (!extent) {
extent = new kendo.dataviz.map.Extent(loc, loc);
} else {
extent.include(loc);
}
}
map.extent(extent);
.