2gis / 2gis/mapsapi

Meta layer click event is incorrectly fired after map drag

Open
#341 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
212
Forks
36
PR merge metrics
No merged PRs in 30d

Description

Steps to reproduce:
Init map:

   DG.then(function () {
       map = DG.map('map', {
           center: [55.75341, 37.602865],
           zoom: 18,
           geoclicker: true,
           poi: {disableLabel: true},
       });

       map.poi.getMetaLayer().on('click', function(e) {
           console.log('poi click!', e)
       });
   });
  1. Click on a parking icon and drag the map a bit
  2. Click on a building near the parking

Expected result:
Geoclicker callout

Actual result:
Geoclicker isn't activated, poi click! is printed in the console

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue from the DG.map setup and the map.poi.getMetaLayer().on('click') entry point, first checking how dragging affects the subsequent click event. Done means clicking a building after dragging activates the Geoclicker callout without logging a poi click event.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.