Skip to content

How to get the coordinates of the marker in the component after changing or dragging. #195

Answered by galexpert
galexpert asked this question in Q&A
Discussion options

You must be logged in to vote

figured it out myself, maybe this information will be useful


    <GMapMarker
            :key="index"
            v-for="(m, index) in markers"
            :position="m.position"
            :clickable="true"
            :draggable="true"
            :dragend="true"
            @dragend="handleMarker"
            @click="openMarker(m.id)"
            @closeclick="openMarker(null)"
        >
      //     :dragend="true" <!--enable event-->
      //      @dragend="handleMarker"  <!--handle on the event-->

 handleMarker(event) {
                              console.log('mapObject lat', event.latLng?.lat());
                console.log('mapObject lng', event.latLng?.lng());
            },

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by galexpert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant