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

Markers are invisible if imageOverlay is used #97

Open
amantalion opened this issue Mar 20, 2021 · 0 comments
Open

Markers are invisible if imageOverlay is used #97

amantalion opened this issue Mar 20, 2021 · 0 comments

Comments

@amantalion
Copy link

amantalion commented Mar 20, 2021

Hi, I tried to use imageOverlay() instead of tileLayer() and my markers became invisible. However, if I click on the area where my marker point should be I get a click and a pop properly. Here is the code that I am using:


var map = L.map('map', {
    crs: L.CRS.Simple
}).setView( [70, 120], 1);

var bounds = [[-26.5,-25], [1021.5,1023]];

var image = L.imageOverlay('uqm_map_full.png', bounds).addTo(map);
map.fitBounds(bounds);

map.setView( [70, 120], 1);

glify.points({
      map,
      size: (i) => {
        return 20;
      },
      color: () => {
        return {
          r: 1,
          g: 0,
          b: 0,
        };
      },
      click: (e, point) => {
        //set up a standalone popup (use a popup as a layer)
        L.popup()
          .setLatLng(point)
          .setContent('You clicked the point at longitude:' + point[glify.longitudeKey] + ', latitude:' + point[glify.latitudeKey])
          .openOn(map);

        console.log(point);
      },
      data: [[145,175.2]]
    })

Any ideas or suggestions would be greatly appreciated.

Screen Shot 2021-03-20 at 4 10 53 PM

@amantalion amantalion changed the title Markers are invisible if used with imageOverlay Markers are invisible if imageOverlay is used Mar 20, 2021
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

1 participant