Fire an event when user tap on Map file.

Hi,

Can you please share the sample code to fire the server side event when user tap on map area.

3 Replies

SS Sheik Syed Abthaheer M Syncfusion Team March 14, 2018 10:42 AM UTC

Hi Ashaar,

Thanks for contacting Syncfusion support.

We have analyzed your query and we have provided the ShapeSelected event, while tapping the Map area as shown in below code.

this.Map.Layers[0].ShapeSelected += Page1_ShapeSelected; 
 
private void Page1_ShapeSelected(object data) 
        { 
            AgricultureData dat = data as AgricultureData; 
            if (dat != null) 
            { 
                Toast.IsVisible = true; 
                State = countryLabel.Text = dat.Name; 
                Type = populationLabel.Text = dat.Type; 
 
                Device.StartTimer(new TimeSpan(0, 0, 3), () => 
                { 
                    Toast.IsVisible = false; 
                    return false; 
                }); 
            } 
        } 


We have prepared the sample based on this. Please find the sample below.

Sample: MapsSample_new 
Regards,
M. Sheik
 



AM Ashaar Mohamed March 14, 2018 11:35 AM UTC

Thank you for your reply, it's working now.

I was trying with the same event in your previous sample from another forum but it's not firing the event :( 

Please refer 
https://www.syncfusion.com/forums/132071/xamarin-app-crashes-when-sfmap-is-loading


SG Sri Gayathri Gopalakrishnan Syncfusion Team March 15, 2018 06:56 AM UTC

Hi Ashaar,  
 
We are glad that your requirement has been achieved and also, we have checked the sample in forum 132071, in which ShapeSelected event fired properly.   
 
Please get back to us if you need any other assistance. 
 
Regards, 
Sri Gayathri. G 


Loader.
Up arrow icon