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

Strange Extra Lines Appearing meanwhile drawing #10

Open
stefanKuijers opened this issue Aug 25, 2022 · 3 comments
Open

Strange Extra Lines Appearing meanwhile drawing #10

stefanKuijers opened this issue Aug 25, 2022 · 3 comments

Comments

@stefanKuijers
Copy link

stefanKuijers commented Aug 25, 2022

First of all, great job on the plugin! It has great potential!

Sadly it seems it's currently breaking at multiple places. But the most prevalent is that when you start drawing a new shape additional lines are shown while after drawing the second vertex.
Screenshot 2022-08-25 at 14 38 37
Screenshot 2022-08-25 at 14 41 46

Besides that I found the following issues:

  • Sometimes while drawing the shape the whole map turns the selected-shape color. This might be related to this issue
  • If we want to change the shape later with 'edit layer' we can't move any of the points and we get an error: Uncaught TypeError: this.findDeepMarkerIndex is not a function. Moving the shape however is fine.

My main question would be: is there any chance you can take a look at it? That would be awesome.

Info:
NPM packages

"leaflet": "^1.8.0",
"leaflet-easybutton": "^2.4.0",
"leaflet-easyprint": "^2.1.9",
"leaflet.markercluster": "^1.5.3",
"@geoman-io/leaflet-geoman-free": "^2.13.0",

Setup:

let map = L.map(mapElement, {
    crs: L.CRS.Simple,
    minZoom: -4,
    maxZoom: 7,
    scrollWheelZoom: false
}) as GeomanMap;
let ortho = new L.PMOrtho(map);

Could it have something to do with that I have an L.CRS.Simple type map?
Or maybe I'm doing something else wrong.

Thanks in advance!

@strfx
Copy link

strfx commented Oct 18, 2022

I am running into the same problem when using this plugin on maps using CRS.Simple. I suspect the behaviour comes from using L.LatLng#distanceTo in _addAngleLine instead of using the CRS-specific distance functions. I'll test this out someday and will eventually create a PR if it works.

@stefanKuijers as a workaround, you can hide these lines by passing showAngleTooltip: false to PMOrtho's options. This will hide the lines, but also the tooltips:

let pmOrtho = new L.PMOrtho(map, {
    // Disabling tooltips fixes the display issue temporarily
    showAngleTooltip: false
});

@Falke-Design
Copy link
Owner

@strfx a PR would be nice!
Currently I have to much work on Leaflet and Leaflet-Geoman to take care of this plugin ...

@stefanKuijers
Copy link
Author

@Falke-Design : I understand, no worries. Focus on what you have to focus on :)

@strfx That does sound great :D Cause in my case I can't go without tooltips. Thanks for already taking a look into this.

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

3 participants