Coder Social home page Coder Social logo

Comments (11)

ArtemZubarev avatar ArtemZubarev commented on August 18, 2024 1

@PNKBizz привет! Каким образом можно добавить событие клика на карту?

from vue-yandex-map.

araimbekoff avatar araimbekoff commented on August 18, 2024 1

событие на карте:
получаем ссылку через
@map-was-initialized="initHandler"
а на полученном объекте делаем, например:

initHandler(obj){
obj.events.add('click', function(e){console.info(e.get('coords'))})
...
}

from vue-yandex-map.

PNKBizz avatar PNKBizz commented on August 18, 2024

@bigperson Добрый!
Ну метки, полилини и многоугольники вы можете создавать уже сейчас, указывая соответствующий marker-type. Эмит событий можно добавить, как и динамическое изменение контента.
Или вы имеете ввиду именно добавление объектов на карту пользователем?

from vue-yandex-map.

bigperson avatar bigperson commented on August 18, 2024

@PNKBizz Да имею ввиду динамическое добавление объектов на карту самим пользователем. http://prntscr.com/hfqoao

from vue-yandex-map.

PNKBizz avatar PNKBizz commented on August 18, 2024

Ок, буду над этим работать!

from vue-yandex-map.

araimbekoff avatar araimbekoff commented on August 18, 2024

Меня тоже этот вопрос интересует. При клике по карте получать координаты lat, lng.
Кааак? Неужели никак?

from vue-yandex-map.

PNKBizz avatar PNKBizz commented on August 18, 2024

@ArtemZubarev @araimbekoff так точно. Для этого и возвращается ссылка на инстанс карты, чтоб можно было делать с ней все, что душе угодно =) Все возможности работы с картой есть в документации на Яндексе

from vue-yandex-map.

ArtemZubarev avatar ArtemZubarev commented on August 18, 2024

@ArtemZubarev @araimbekoff круто спасибо!

from vue-yandex-map.

fynduck avatar fynduck commented on August 18, 2024

Добрый день.
Есть какой то способ чтоб автоматически определять цент и зум карты в зависимости от меток?

from vue-yandex-map.

PNKBizz avatar PNKBizz commented on August 18, 2024

@fynduck компонент карты кидает событие map-was-initialized после инициализации в котором в качестве payload передает ссылку на инстанс карты. Дальше делаете с ним что угодно: https://tech.yandex.ru/maps/doc/jsapi/2.1/ref/reference/Map-docpage/#setBounds

from vue-yandex-map.

fynduck avatar fynduck commented on August 18, 2024

@PNKBizz Спасибо, не сразу нашел но хотя бы знал где копать ;)

from vue-yandex-map.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.