Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draggable, update longlat after dragging the marker #71

Closed
vlasvlasvlas opened this issue Mar 30, 2016 · 4 comments
Closed

draggable, update longlat after dragging the marker #71

vlasvlasvlas opened this issue Mar 30, 2016 · 4 comments

Comments

@vlasvlasvlas
Copy link

Hi, i needed to get the new longlat after i dragged the marker, i already set draggable true at geosearch.js

this is my js

      new L.Control.GeoSearch({
              provider: new L.GeoSearch.Provider.Esri()
          }).addTo(m);


        m.on('geosearch_showlocation', (result) => {

        markerLng = result.Location.X;

        markerLat = result.Location.Y;

        });

i understand i must get the dragend something like:

marker.on('dragend', function(event) {
    var marker = event.target;  
    var result = marker.getLatLng(); 
    console.log(result);
});

but i cant find how the name of the created marker

txs!

@interactivevalues
Copy link

hi, did you find a solution?
I have the same problem right now!

cheers,
ToM

@smeijer
Copy link
Owner

smeijer commented May 19, 2017

Thanks to @ville6000, this should now be possible by listening to the geosearch/marker/dragend event.

@mfreeman451
Copy link

How do I do this in the Vue component?

@mfreeman451
Copy link

mfreeman451 commented Apr 22, 2019

mounted () {
this.$nextTick(() => {
this.$refs.myMap.mapObject.on('geosearch/marker/dragend', this.handleMarkerDrag)
})
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants