This is a migrated thread and some comments may be shown as answers.

Marker and SignalR

3 Answers 176 Views
Map
This is a migrated thread and some comments may be shown as answers.
KRichter
Top achievements
Rank 1
KRichter asked on 05 Jun 2018, 12:06 PM

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()
    )

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 07 Jun 2018, 05:41 AM
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.
0
KRichter
Top achievements
Rank 1
answered on 07 Jun 2018, 06:45 AM

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

0
Accepted
Stefan
Telerik team
answered on 08 Jun 2018, 07:22 AM
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.
Tags
Map
Asked by
KRichter
Top achievements
Rank 1
Answers by
Stefan
Telerik team
KRichter
Top achievements
Rank 1
Share this question
or