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 - วิทยาศาสตร์และเทคโนโลยี
Thanks Gerald. Great video and thank you for making it. Love your presentation pace and level of details.
Sorry for only seeing this now, but thank you so much for the kind words!
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!!!!
Happy to hear that! From Brazil, that is amazing! Thank you for the kind words and taking the time to let me know :)
Awesome video and content, Thanks Gerald
Much appreciated!
This is another great video
Glad you think so!
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
Thanks Dan! Pins is definitely something I wanted to also do :)
great content :D
Thank you!
Very good post :D
Yay thanks! :D
Hai bro super content
Thank you! 🙏
Great work Gerald do have a google search with a search bar tutorial
I'm afraid not, sorry!
how can i do this with mvvm?
hey how do i do this in view model instead of code behind? great video, thanks
The short answer is: convert everything to data binding :D I'll see if I can do more with MVVM
Hi there Gerald, could you please do a video on how to get pixel positions of where you click on an image using Xamarin.
Of an image or a map or what exactly?
Is it possible to get nearby places? for example I want all nearby places around few meters or KM from my current location.
Not through this, you will have to use the Google Places API :)
1mile = 1.6 km. Cool video. Is it ok to use xamarin.maps in place of Getlocationasync? Getlocationasync often errors out across Android versions.
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 :)
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?
Absolutely but it will require custom renderers or a plug-in since that functionality is not available by default
@@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
@@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
How i do this on MAUI?
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.
You can but not with this. You’ll want to look at the Google Places API. I think Azure Maps has something similar
@@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.
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 :)
Yes, so many things going on
Always!
@@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
We getting close to navigating users??? Thanks
What is your definition of "navigating users"?
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!
Thanks for watching! Sehr güt! I'll add the idea to the list, although it's a hard one!
Hi Gerald . thank you ... I have an Error ... Java.IO.IOException: 'grpc failed'
Without any details on what you're doing it's impossible to know what might be going on :)
@@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'
u need internet bro
Very good. I copy your codes hahaha
Haha please watch out! I create bugs too and it's sample code which is not always great ;)