Getting Coordinates and Addresses with Xamarin.Forms.Maps

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ส.ค. 2024
  • Xamarin.Forms.Maps has a lot of great features! One of them is the easy ability to get coordinates from just a tap on the map. Also, it has a geocoder built-in! That means you can get addresses from coordinates and vice versa.
    In this video we will see all of that and as a bonus how to move the map to a certain region!
    💝 Join this channel to get access to perks:
    th-cam.com/users/GeraldVerslui...
    🛑 Don't forget to subscribe to my channel for more amazing content: th-cam.com/users/GeraldVerslui...
    🐦 Follow me on Twitter: / jfversluis
    🤝 Join the Discord server: / discord
    🔗 Links
    Sample App Repo: github.com/jfversluis/XFMapsG...
    Setup Maps Video: • Setup Maps in Your Xam...
    Essentials Geocoding: • Address to Coordinates...
    Maps Docs Page: docs.microsoft.com/xamarin/an...
    Xamarin Forms Repo: github.com/xamarin/Xamarin.Forms
    ⏱ Timestamps
    00:00 - Intro
    00:21 - Inspect End Result
    01:14 - Shoutout Time!
    01:49 - Sample App Outline
    03:02 - Xamarin.Forms.Maps NuGet Package
    03:29 - Get Coordinates on Tap on Map
    05:26 - Get Address From Coordinates
    09:10 - Address To Coordinates
    11:58 - Move Map To Certain Region
    15:10 - Outro
    🎥 Video edited with Camtasia (ref): techsmith.z6rjha.net/AJoeD
    🙋‍♂️ Also find my...
    Twitter: / jfversluis
    Blog: blog.verslu.is
    Twitch: / jfversluis
    All the rest: jfversluis.dev
    #XamarinForms #Maps #Location #Xamarin #GoogleMaps #AppleMaps #BingMaps #Geocoding
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 49

  • @kelipyap
    @kelipyap 2 ปีที่แล้ว

    Thanks Gerald. Great video and thank you for making it. Love your presentation pace and level of details.

    • @jfversluis
      @jfversluis  2 ปีที่แล้ว

      Sorry for only seeing this now, but thank you so much for the kind words!

  • @AngeloBestetti
    @AngeloBestetti 3 ปีที่แล้ว +1

    Hi Gerald, Angelo from Brazil, dude I´m watching every single one video of yours and it´s amazing easy how you explain everything. Keep going this way!!!!

    • @jfversluis
      @jfversluis  3 ปีที่แล้ว +1

      Happy to hear that! From Brazil, that is amazing! Thank you for the kind words and taking the time to let me know :)

  • @usamaelhamed4324
    @usamaelhamed4324 3 ปีที่แล้ว

    Awesome video and content, Thanks Gerald

    • @jfversluis
      @jfversluis  3 ปีที่แล้ว

      Much appreciated!

  • @MuhammadNadeem-wj6xd
    @MuhammadNadeem-wj6xd 3 ปีที่แล้ว +1

    This is another great video

    • @jfversluis
      @jfversluis  3 ปีที่แล้ว +1

      Glad you think so!

  • @dancluderay1304
    @dancluderay1304 3 ปีที่แล้ว

    Great set of videos on implementing maps. Would be great to see how you can pin other locations on a map. For example, if you wanted to show where you are in relation to another location and maybe have different custom icons for each position. Many thanks dan

    • @jfversluis
      @jfversluis  3 ปีที่แล้ว +1

      Thanks Dan! Pins is definitely something I wanted to also do :)

  • @selimtv3428
    @selimtv3428 3 ปีที่แล้ว

    great content :D

  • @checox1909
    @checox1909 3 ปีที่แล้ว

    Very good post :D

  • @muhammedyasir345
    @muhammedyasir345 3 ปีที่แล้ว

    Hai bro super content

  • @sizwenduduzow7139
    @sizwenduduzow7139 2 ปีที่แล้ว

    Great work Gerald do have a google search with a search bar tutorial

    • @jfversluis
      @jfversluis  2 ปีที่แล้ว

      I'm afraid not, sorry!

  • @kemistrypops
    @kemistrypops 2 ปีที่แล้ว +1

    how can i do this with mvvm?

  • @kemistrypops
    @kemistrypops 3 ปีที่แล้ว

    hey how do i do this in view model instead of code behind? great video, thanks

    • @jfversluis
      @jfversluis  2 ปีที่แล้ว

      The short answer is: convert everything to data binding :D I'll see if I can do more with MVVM

  • @vandadmossavand
    @vandadmossavand 3 ปีที่แล้ว

    Hi there Gerald, could you please do a video on how to get pixel positions of where you click on an image using Xamarin.

    • @jfversluis
      @jfversluis  3 ปีที่แล้ว

      Of an image or a map or what exactly?

  • @hrishikeshgarud7177
    @hrishikeshgarud7177 2 ปีที่แล้ว

    Is it possible to get nearby places? for example I want all nearby places around few meters or KM from my current location.

    • @jfversluis
      @jfversluis  2 ปีที่แล้ว +1

      Not through this, you will have to use the Google Places API :)

  • @anandshindey
    @anandshindey 3 ปีที่แล้ว

    1mile = 1.6 km. Cool video. Is it ok to use xamarin.maps in place of Getlocationasync? Getlocationasync often errors out across Android versions.

    • @jfversluis
      @jfversluis  3 ปีที่แล้ว

      Ah cool that I remembered that correctly!
      So, I think those do two separate things. The GetLocationAsync gets your location, while what I am showing gets a location that is on the map :)

  • @KadirAksu28
    @KadirAksu28 2 ปีที่แล้ว

    For my mobile project for college, I'm trying to add animal icon into the map whenever I tap into a random location. That pin should also have it's own detail page and time period of it, let say it will be gone after 7 hours, is there any way to do this with Xamarin.Forms maps?

    • @jfversluis
      @jfversluis  2 ปีที่แล้ว

      Absolutely but it will require custom renderers or a plug-in since that functionality is not available by default

    • @KadirAksu28
      @KadirAksu28 2 ปีที่แล้ว

      @@jfversluis Is there any blog you know about this perhaps a link to it? I'm kinda lost but thank you for your quick respond, I will try to look for different plug ins and custom renderers

    • @jfversluis
      @jfversluis  2 ปีที่แล้ว +1

      @@KadirAksu28 it’s even in the official Docs :) docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/custom-renderer/map-pin
      You might want to use TK Maps that was always pretty good with some features

  • @francescp.4778
    @francescp.4778 ปีที่แล้ว

    How i do this on MAUI?

  • @richardkoontz7809
    @richardkoontz7809 2 ปีที่แล้ว

    Is there a way to show places around the user like coffee shops, restaurants, and only pin those. I am specifically looking for vets and animal shelters for a type of place. Any help would be really appreciated.

    • @jfversluis
      @jfversluis  2 ปีที่แล้ว

      You can but not with this. You’ll want to look at the Google Places API. I think Azure Maps has something similar

    • @richardkoontz7809
      @richardkoontz7809 2 ปีที่แล้ว

      @@jfversluis Is there any way that I can help on this? Could you do a video on getting google places working? Or even help with some code to get me going? Thank you in advance.

  • @cesarfernandezgonzalez6344
    @cesarfernandezgonzalez6344 2 ปีที่แล้ว

    Hello! your videos help me a lot to do my final work degree. i was wondering if is it posible to, in my case, click a restaurant and get the restaurant name back. Thanks!! and sorry for my english haha :)

  • @MusicalGeniusBar
    @MusicalGeniusBar 3 ปีที่แล้ว +1

    Yes, so many things going on

    • @jfversluis
      @jfversluis  3 ปีที่แล้ว

      Always!

    • @MusicalGeniusBar
      @MusicalGeniusBar 3 ปีที่แล้ว

      @@jfversluis this is one of the few channels out of the hundreds that i subscribe to that i wait each day for your videos to come out. Keep it up

  • @nkazimulojudgement3583
    @nkazimulojudgement3583 3 ปีที่แล้ว

    We getting close to navigating users??? Thanks

    • @jfversluis
      @jfversluis  3 ปีที่แล้ว

      What is your definition of "navigating users"?

  • @CraftKing94
    @CraftKing94 3 ปีที่แล้ว +1

    Hi Gerald, i am from Germany. I watch many videos from your channel to improve my Xamarin Development. It would be really nice if you can do a video about opening a file with your app. I want to clarify that with a scenario. Like on windows you can right-click on a file and say "open with". I want that my App is listed there for a custom file type. I already achieved that but i cant get the handling of this request to work. Of course i want to achieve that for UWP, Android and iOS if possible.
    Would be really nice. Nad maybe someone else can help me with that. I think that use case is very common.
    Thank You!

    • @jfversluis
      @jfversluis  3 ปีที่แล้ว

      Thanks for watching! Sehr güt! I'll add the idea to the list, although it's a hard one!

  • @acc6540
    @acc6540 3 ปีที่แล้ว

    Hi Gerald . thank you ... I have an Error ... Java.IO.IOException: 'grpc failed'

    • @jfversluis
      @jfversluis  3 ปีที่แล้ว

      Without any details on what you're doing it's impossible to know what might be going on :)

    • @acc6540
      @acc6540 3 ปีที่แล้ว

      ​@@jfversluis nothing special
      private readonly Geocoder geocoder = new Geocoder();
      private async void myMap_MapClicked(object sender, MapClickedEventArgs e)
      {
      var address = await geocoder.GetAddressesForPositionAsync(e.Position);
      await DisplayAlert("Address", $"address : {address.FirstOrDefault()?.ToString()}", "ok");
      }
      Error : Java.IO.IOException: 'grpc failed'

    • @benboateng1820
      @benboateng1820 2 ปีที่แล้ว

      u need internet bro

  • @josedonizeteoliveirajunior1744
    @josedonizeteoliveirajunior1744 3 ปีที่แล้ว

    Very good. I copy your codes hahaha

    • @jfversluis
      @jfversluis  3 ปีที่แล้ว +1

      Haha please watch out! I create bugs too and it's sample code which is not always great ;)