Marker and SignalR

4 posts, 1 answers
  1. Dietmar
    Dietmar avatar
    15 posts
    Member since:
    May 2012

    Posted 05 Jun 2018 Link to this post

    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("&copy; <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()
        )

  2. Stefan
    Admin
    Stefan avatar
    2524 posts

    Posted 07 Jun 2018 Link to this post

    Hello, Dietmar,

    Thank you for the details.

    In general, the Map should work with SignalR if the data is received in the expected format.

    Still, this is the SignalR type was mainly made and testes for the Grid and the Charts.

    If sending an example is not possible, please share with us the error that occurs and the response received from the server when reading the data.

    Thank you in advance for the cooperation.

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Dietmar
    Dietmar avatar
    15 posts
    Member since:
    May 2012

    Posted 07 Jun 2018 in reply to Stefan Link to this post

    Hello Stefan,

     

    thank you for your reply. The map wont subscribe to signalr as far as i can tell. the javascript error tells "not enough stackspace".

    Markers are now filled by the viewmodel and i wrote javascript functions to manipulate the markers. these subscribe signalr and are triggered from signalr. so the clients only refresh the markers wich are updated.

    sidenote: markers have no real key, so i write the intern guid in the title of the marker to recognize the one i have to update. all information for the marker is stored in the tooltip content. this way the user see all information and i can manage the markers.

    it would be blaze if the map markers would be a observable collection for mvc.this way you could update it through the viewmodel.

     

    have a nice day

  4. Answer
    Stefan
    Admin
    Stefan avatar
    2524 posts

    Posted 08 Jun 2018 Link to this post

    Hello, Dietmar,

    I'm glad to hear that a solution is found.

    Thank you for sharing the approach with the Kendo UI community, it is highly appreciated.

    As for using an observable collection, I can suggest submitting a feature request and based on its popularity the team may create options for achieving the desired result:

    http://kendoui-feedback.telerik.com/forums/127393-kendo-ui-feedback?category_id=46166

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top