Read More
Read now

Create a Draggable Map Like Uber , OLA in iOS using Swift 4

Save

Draggable Map.

We have seen the Ola or Uber map where the pin is located in middle of Google Map & we can Drag the Map or Zoom also after doing all this , map stop dragging or zooming then

it will show their actual address where the pin located. In iOS we can use Apple Map or Google Map so here I have taken the Example of Google Map.

Please follow this steps.

1: Install the Google Map Framework through POD.

2: Write the Gopogle Map Key in Appdelegate class.

3: Create a view controller & take a one UIView .

Take the one UIView in UIViewController & set the leading , trailing , top , bottom constraints to super view , after that take one UIImageView in middle of UIView and set the constraints  center Horizontal & center vertical.

 

4: Create outlet of UIview & pin Image.

5 : Now setup your Map for this I have written the function where i have set the default latitude & longitude.

Note: it will show the PIN image on your given Latitude & Longitude position. 

Now I have to  implement the dragging functionality for this you need to write the delegate method to check when the map is at idle position after dragging. here i have used the geocode for getting the address through latitude & longitude.

 

6: This Method will call when the Map is at idle position after dragging.

Note: Now you can get the PIN position Address.

 

 

 

 

Thanks for reading this Technical blog, I Hope this is helpful for you. If you got any query or issue please ask me on the comment below.

                                                                                                                                                     Stay updated and Stay Cool. 🙂

 

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


7 comments

  • Aashish
    Could you plaese send me the source code
  • Aashish
    Could you plaese send me the source code?
    • kunal prasad (Moderator)
      Can you tell me, what’s an issue you are facing?
      • aashish
        PIN position Address ,city is not fetched on the textfield.
  • Kiran
    I am requesting for the source code for the implementation which you have done
  • vinay
    The tutorial is great, but it would be even wonderful. if you can make the source code available for download.
  • KOSURU UDAY SAIKUMAR
    Can you please upload the source code
  • css.php

    Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!

    Deniel Kerr

    Owner and Founder. Opencart

    Talk to Sales
    Start a Project

      Message Sent!

      If you have more details or questions, you can reply to the received confirmation email.

      Back to Home