hi, i have implement google map in my application and also i have inserted markers according to some lattitude and longitude. and now i want i implement marker click event(onmarkerclick) in my application please help any one.
how can i implement this ?.
My code is for implement marker
_map.AddMarker(new MarkerOptions().SetPosition(getlatlong).SetTitle(CompanyName).SetSnippet("Sold: " + Sold + "Offered: " + Offered));
Posts
What does this have to do with Visual Studio?
actually i want to implement, google maps marker info window click using visual studio in mono android....
please reply as soon as possible.
thanks in advance.....
Hi, GoogleMap class has MarkerClick event.
Yeah but if you work with a PCL project so you wil create a
CustomPin
object or what ever. Then in the MapRenderer, you need to know which custom pins has been clicked, but how? In both Android & UWP I have aDictionnary<MapIcon/Marker, CustomPin>
so then, I search from either theMapIcon
or theMarker
. However, it only works for UWP, on Android the dictionnary cannot find the relatedCustomPin
..I found something !
This is my dictionnary:
Then I add this :
So I got handle the click like that
@Emixam23 can i see your source code for custom pin properties?
I now have a full implementation
Just over here => https://github.com/Emixam23/XamarinByEmixam23/tree/master/Detailed Part/Controls/Map
However, I haven't updated it since a while
@Emixam23 wow thank you very much i'll check that.
@Emixam23 hi i checked your project and saw it's a xamarin.forms project. Can i implement it on xamarin.android?
Check this file in the Xamarin.Droid part, because even if it's a Xamarin.Forms project, it can't be implemented without a renderer
https://github.com/Emixam23/XamarinByEmixam23/blob/master/Detailed Part/Controls/Map/MapPinsProject/MapPinsProject/MapPinsProject.Droid/CustomRenderer/CustomMapRenderer.cs
Also, this file is the source code you were asking above
@Emixam23 thanks you very much! big help for me.
You're welcome buddy, good luck !