Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70440

Ionic 3: Get formatted address of the Marker After dragged on Map

$
0
0

@harshm90 wrote:

I have made a Google map that shows the current address on the map. I also have draggable marker which is fixed at the center of map. So the user can change the marker by moving map.

I am trying to fetch the formatted address of the marker when loaded & also want to display the formatted address after dragged. How can i achieve that?

I have tried a few methods from google documentation but couldn’t find the proper solution.

Below is my .ts file

this.geocoder = new google.maps.Geocoder();
    this.geolocation.getCurrentPosition().then((position) => {
      let latLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
      var mapOptions = {
        center: latLng,
        zoom: 17,
        streetViewControl: false,
        mapTypeControl: false,
        fullscreenControl: false,
        mapTypeId: google.maps.MapTypeId.ROADMAP
      };

      this.map = new google.maps.Map(this.mapRef.nativeElement, mapOptions);

      google.maps.event.addDomListener(window, 'load', this.map);

    }, (err) => {
      console.log(err);
    });

I also tried this Method but with this instead of map I see only blank page.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70440

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>