Binding pinClick, MapClick and PinSelect to events doesn't appear to work.
See original GitHub issueFrom what I can tell subscribing the pinselect, mapclick or pinclick events don’t appear to work.
This is how I’m doing it:
`mapView.SetBinding(TKCustomMap.CustomPinsProperty, "Pins");
mapView.SetBinding(TKCustomMap.MapClickedCommandProperty, "MapClickedCommand");
mapView.SetBinding(TKCustomMap.MapLongPressCommandProperty, "MapLongPressCommand");
mapView.SetBinding(TKCustomMap.MapCenterProperty, "MapCenter");
mapView.SetBinding(TKCustomMap.PinSelectedCommandProperty, "PinSelectedCommand");
mapView.SetBinding(TKCustomMap.SelectedPinProperty, "SelectedPin");
mapView.SetBinding(TKCustomMap.RoutesProperty, "Routes");
mapView.SetBinding(TKCustomMap.PinDragEndCommandProperty, "DragEndCommand");
mapView.SetBinding(TKCustomMap.CirclesProperty, "Circles");
mapView.SetBinding(TKCustomMap.CalloutClickedCommandProperty, "CalloutClickedCommand");
mapView.SetBinding(TKCustomMap.PolylinesProperty, "Lines");
mapView.SetBinding(TKCustomMap.PolygonsProperty, "Polygons");
mapView.SetBinding(TKCustomMap.MapRegionProperty, "MapRegion");
mapView.SetBinding(TKCustomMap.RouteClickedCommandProperty, "RouteClickedCommand");
mapView.SetBinding(TKCustomMap.RouteCalculationFinishedCommandProperty, "RouteCalculationFinishedCommand");
mapView.SetBinding(TKCustomMap.TilesUrlOptionsProperty, "TilesUrlOptions");
mapView.SetBinding(TKCustomMap.MapFunctionsProperty, "MapFunctions");
mapView.IsRegionChangeAnimated = true;
mapView.PinSelected += pinClicked;
mapView.MapClicked += mapClicked;
mapView.PinDragEnd += pinDragEnd;`
and the event methods for example the map click one are as below:
` private void mapClicked(object sender, TKGenericEventArgs<Position> e)
{
var loc_ = new Position(e.Value.Latitude, e.Value.Longitude);
mapView.Pins.Clear();
var _pin = new Pin
{
Label = "Concern Location",
Position = loc_
};
mapView.Pins.Add(_pin);
mapView.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(_pin.Position.Latitude, _pin.Position.Longitude), Distance.FromMiles(0.3)));
}`
Any suggestions or is this a bug?
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Why is the click event on a map pin not working?
The reason why the Pushpin click handler which shows the Infobox is not firing is because of errors in the click handler that...
Read more >Xamarin.Forms.Maps - How to fire pin click event ...
You can use Map_PinClicked to handle the PinClick event, If you set e.Handled = true , then Pin selection doesn't work automatically. All...
Read more >TK.CustomMap 1.5.1
TK.CustomMap lets you customize pins, add overlays, calculate routes and many more! It is designed with MVVM in mind.
Read more >TK.CustomMap 1.5.1-pre1
TK.CustomMap lets you customize pins, add overlays, calculate routes and many more! It is designed with MVVM in mind.
Read more >VidyoConferencing Admin Guide
Whenever a task cannot be undone the following warning appears before the task is ... to use all of the capabilities of Vidyo...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Check the pull requests (i have sent one for the samples) and other issues, you will find the answer 😃
Looks totally fine to me, will check if I finally find some time to create 1.5.1.