0

I am trying to call a binding element to set the position on map. I read somewhere that the double doesn't accept bindings. What can I do to pass that values? thank you in advance

  <map:Map x:Name="amap">
                <x:Arguments>
                    <map:MapSpan>
                        <x:Arguments>
                            <map:Position>
                                <x:Arguments>
                                    <x:Double>
                                         Binding Country.Longitude
                                    </x:Double>
                                    <x:Double>
                                        Binding Country.Latitude
                                    </x:Double>
                                </x:Arguments>
                            </map:Position>
                            <x:Double>0.01</x:Double>
                            <x:Double>0.01</x:Double>
                        </x:Arguments>
                    </map:MapSpan>
                </x:Arguments>
            </map:Map>
ToolmakerSteve
  • 18,547
  • 14
  • 94
  • 196
GCP
  • 1
  • 2
  • 1
    The map Position is not bindable. Does this answer your question? [How to bind the position value of Xamarin.forms.Maps inside the ListView?](https://stackoverflow.com/questions/65390620/how-to-bind-the-position-value-of-xamarin-forms-maps-inside-the-listview) – ToolmakerSteve Apr 06 '22 at 18:20
  • unfortunately not. I've seen that answer already but my values came from an API. I can't make a list or define the values, that's why I have to use the binding... but thank you for your help – GCP Apr 07 '22 at 17:02
  • If you give more details in your question about the situation, perhaps someone can suggest an approach that you have not thought of. Since it can't be done on the individual map positions, it would have to be events at a higher level, to communicate with the API, and locally cache a list of positions, then tell map to display them. The hard part is "going the other direction" - telling API about changes that the user wants to make. This might require some solution that is not as convenient for the user as you had hoped. But it is what it is. – ToolmakerSteve Apr 07 '22 at 17:26

0 Answers0