TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Thamsanqa Ngcongwane
NA
184
25k
How to Display Pop Up when the Polygon is clicked in Xamarin
Feb 4 2020 8:28 AM
I'm using WEB API to retrieve coordinates and display them as polygons on my Map. Now I want to make those Polygons(To be Clickable) when they clicked to display a pop with more information from the API.
My Xaml:
<
StackLayout
>
<
maps:Map
x:Name
=
"map"
>
<
x:Arguments
>
<
maps:MapSpan
>
<
x:Arguments
>
<
maps:Position
>
<
x:Arguments
>
<
x:Double
>
-30.241943
</
x:Double
>
<
x:Double
>
25.771944
</
x:Double
>
</
x:Arguments
>
</
maps:Position
>
<
x:Double
>
20
</
x:Double
>
<
x:Double
>
20
</
x:Double
>
</
x:Arguments
>
</
maps:MapSpan
>
</
x:Arguments
>
<
maps:Map.MapElements
>
</
maps:Map.MapElements
>
</
maps:Map
>
</
StackLayout
>
C# code for adding my Polygons to the map:
foreach
(var tempList
in
warningAlertsList)
{
string
alertType = tempList.AlertType;
if
(alertType ==
"Advisory"
)
{
polygon =
new
Polygon();
polygon.StrokeColor = Color.FromHex(
"ffff00"
);
polygon.FillColor = Color.FromHex(
"ffff00"
);
polygon.StrokeWidth = 5f;
foreach
(var Poly
in
tempList.Polygon)
{
float
Lat =
float
.Parse(Poly[0]);
float
Long =
float
.Parse(Poly[1]);
polygon.Geopath.Add(
new
Position(Lat, Long));
}
// add to map
map.MapElements.Add(polygon);
Reply
Answers (
0
)
Page load events
How to create Dashboard with auto search for users in DB?