Marker On Click

4 posts, 0 answers
  1. Nick
    Nick avatar
    17 posts
    Member since:
    Jan 2012

    Posted 01 Sep 2015 Link to this post

    Is there a way to handle the Marker on Click on a server side event?

    I would like to change the contents of other controls on the page using the data obtained from the Marker location.

    Thank you,

    Nick

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3599 posts

    Posted 01 Sep 2015 Link to this post

    Hello Nick,

    RadMap for ASP.NET AJAX is a JavaScript-based widget (it is actually a server wrapper over the Kendo UI Map widget). Thus, it does not offer server-side events. We have facilitated databinding to common datasources, but its primary focus is client-side interaction.

    That being said, if changing the page content via JavaScript is not an option, I can suggest the following:

    1. capture the markerClick event (http://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/map#events-markerClick)
    2. initiate some form of a server request (http://www.telerik.com/blogs/different-ways-to-make-a-request-to-the-server). For example, an AJAX request through the RadAjaxManager/RadAjaxPanel client-side API (http://docs.telerik.com/devtools/aspnet-ajax/controls/ajax/client-side-programming/overview).


    Regards,

    Marin Bratanov
    Telerik
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nick
    Nick avatar
    17 posts
    Member since:
    Jan 2012

    Posted 01 Sep 2015 in reply to Marin Bratanov Link to this post

    Marin, yes, I already figured it out that I must use the ajaxManager to call the server side function.

    That being said, I'm not being able to bind the markerClick event to a javascript function. 

     Assuming I have a simple RadMap as shown below, can you please give me  a sample javascript code to bind the event correctly

            <telerik:RadMap runat="server" ID="rmMain" Zoom="4" CssClass="MyMap" >
                <CenterSettings Latitude="40" Longitude="-100" />
                <DataBindings>
                    <MarkerBinding DataShapeField="Shape" DataLocationLatitudeField="Latitude" DataLocationLongitudeField="Longitude" />
                </DataBindings>
                <LayersCollection>
                    <telerik:MapLayer Type="Tile" Subdomains="a,b,c"
                        UrlTemplate="http://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png"
                        Attribution="&copy; <a href='http://osm.org/copyright' title='OpenStreetMap contributors' target='_blank'>OpenStreetMap contributors</a>.">
                    </telerik:MapLayer>
                </LayersCollection>
                <ClientEvents OnLoad="mapLoad" />
            </telerik:RadMap>​

  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3599 posts

    Posted 01 Sep 2015 Link to this post

    Hello Nick,

    Since the matter is now about attaching the client-side handler, I would suggest continuing this discussion in the other thread we have: http://www.telerik.com/forums/map-marker-onclick-event-help#zFBvB6RNP0ubaQb8qQEaDw. It provides two additional examples.

    Regards,

    Marin Bratanov
    Telerik
Back to Top