Leaflet.glify icon indicating copy to clipboard operation
Leaflet.glify copied to clipboard

Markers are invisible if imageOverlay is used

Open amantalion opened this issue 3 years ago • 0 comments

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 avatar Mar 20 '21 23:03 amantalion