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

Unable to zoom the map when pinching with multitouch on top of a marker (both fingers on top of the marker) #9258

Open
3 of 4 tasks
fwzac opened this issue Feb 13, 2024 · 0 comments
Labels
bug needs triage Triage pending

Comments

@fwzac
Copy link

fwzac commented Feb 13, 2024

Checklist

  • I've looked at the documentation to make sure the behavior isn't documented and expected.
  • I'm sure this is an issue with Leaflet, not with my app or other dependencies (Angular, Cordova, React, etc.).
  • I've searched through the current issues to make sure this hasn't been reported yet.
  • I agree to follow the Code of Conduct that this project adheres to.

Steps to reproduce

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Leaflet Map with Markers</title>
  <link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
  <style>
    #map { height: 400px; }
  </style>
</head>
<body>
  <div id="map"></div>

  <script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
  <script>
    // Sample data for markers
    var markersData = [
      {
        lat: 51.505,
        lng: -0.09,
        title: 'Marker 1',
        description: 'This is the first marker. It can contain any details you want to show in the popup.'
      },
      {
        lat: 51.51,
        lng: -0.1,
        title: 'Marker 2',
        description: 'This is the second marker. You can customize the content here as per your requirements.'
      }
    ];

    // Initialize the map
    var map = L.map('map').setView([51.505, -0.09], 13);

    // Add the base OpenStreetMap layer
    L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
      attribution: '© OpenStreetMap contributors'
    }).addTo(map);

    // Add markers with custom popups
    markersData.forEach(function(marker) {
      L.marker([marker.lat, marker.lng]).addTo(map)
        .bindPopup("<b>" + marker.title + "</b><br>" + marker.description);
    });
  </script>
</body>
</html>

Expected behavior

Upon zooming with touch (two fingers or pinching) from mobile it suppose to zoom like the map because i can see that the event is captured from the Map as you can see below for the marker
image

and the map:
image

Current behavior

the current behaviout is that everytime i tried to pinch on top of the marker it wont let me zoom the map. is there any way to do that ? like maybe passing the event to the map by creating new TouchEvent, i've tried that but it doesn't work and maybe i've missed some crucial information here. Your help would be much appreciated

Minimal example reproducing the issue

No response

Environment

  • Leaflet version: 1.7.1
  • Browser (with version): Chrome DevTools mobile
  • OS/Platform (with version): Android
@fwzac fwzac added bug needs triage Triage pending labels Feb 13, 2024
@fwzac fwzac changed the title Unable to zoom the map when on top of a marker Unable to zoom the map when pinching with multitouch on top of a marker (both fingers on top of the marker) Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs triage Triage pending
Projects
None yet
Development

No branches or pull requests

1 participant