question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Binding pinClick, MapClick and PinSelect to events doesn't appear to work.

See original GitHub issue

From 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:closed
  • Created 7 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
JeanCollascommented, Oct 5, 2016

Check the pull requests (i have sent one for the samples) and other issues, you will find the answer 😃

1reaction
TorbenKcommented, Aug 15, 2016

Looks totally fine to me, will check if I finally find some time to create 1.5.1.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found