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

How to get coords on click #16

Closed
drev74 opened this issue Oct 15, 2022 · 2 comments
Closed

How to get coords on click #16

drev74 opened this issue Oct 15, 2022 · 2 comments

Comments

@drev74
Copy link

drev74 commented Oct 15, 2022

Hello I'm plaing with ymaps beta now. Thanks for building it !

I need to capture coords on some event, say a double click. As per docs, I can do that with :

myMap.events.add('click', function (e) {
    // Получение координат щелчка
    var coords = e.get('coords');
    alert(coords.join(', '));
});

And here's my component:

<StaticDotsComponent
  :pos="pos"
  @dblclick="onDblClick" />

When I print that event, I'm getting this:

onDblClick called: {"isTrusted":true,"_vts":1665844024878}

How do I capture coords? I don't see any @created or @initialized events yet

Thanks !

@PNKBizz
Copy link
Member

PNKBizz commented Oct 17, 2022

Please create repo with your code and publish link. Don't understand what you mean

@drev74
Copy link
Author

drev74 commented Oct 22, 2022

Hi Fixed my issue with the following:

<template>
  <yandex-map
    :settings="settings"
    :coordinates="center"
    :zoom="zoom"
    @click="onMapClick"
  >
    <yandex-marker
      :marker-id="123"
      :coordinates="center"    
      @click="onMarkerClick"
    >
      <template #component>
        <TaggedBalloon :name="name" />
      </template>
    </yandex-marker>
  </yandex-map>
</template>

@drev74 drev74 closed this as completed Oct 22, 2022
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

2 participants