Closed CityBelfast closed 3 years ago
I was not able to reproduce this. Is it possible that you upload this to a server, so that I can look on it?
Else here my attempt: https://jsfiddle.net/falkedesign/cuasby2j/
Also try to use the newest version of Leaflet 1.7.1
I don't think that this makes a problem. This is really strange...
Out of interest what are these functions they are you using from leaflet-draw?
We use leaflet-draw tool for our existing functionality to plot normal boundary. But this tool doesn't support multi-geometry editing. That is the reason, we are trying to use leaflet-geoman
So you are not missing any functions of leaflet-draw in geoman? 👍
I don't think so as there are a few extra functionality exists in geoman like multi-geometry, snapping, drag geometry, which makes this tool more attractive to use it. hopefully the bug will get resolved once I update with the latest leaflet version. I will let you know the outcome of version upgrade.
the leaflet libary got updated with 1.7.1 version. but I'm still getting the error when move small circle marker while editing geometry. In fact, this issue is only in Dev system.
It would be very helpful to have the code. Would it possible that you send me the project over Google Drive or so?
Can you debug it in the browser? If you don't know how, I can make you an description
it is a massive project. As per company policy, I don't think I'm allowed to copy anything to outside. would you please make a description to debug it in the browser please? do you want me to debug leaflet.geoman.min.js file locally?
I think that you use the npm modul of geoman, if not it is the similar behaviour but in a different source folder:
I'm interested what are the value of the variable which calls forEach
where the error is thrown. Because normally the variable is always an array, so I don't understand why it is not anymore an array.
Also please click on the script-link "leaflet.geoman.min.js:1" at i.handleLayerAdditionInGlobalEditMode (leaflet.geoman.min.js:1)
in the error. And expand the script same as in the video and then please send me an screenshot if it looks different as in the video.
here is the screenshot. but addedLayers array is undefined.
I'm just wondering, is it something do with the blow line of code in the geoman file as I'm adding layers directly to group layer rather than adding into map.
this.map.on("layeradd", this._layerAdded, this),
Can you please try to use
var data = JSON.parse("{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[-236.601563,57.891497],[-193.007813,14.264383],[-260.507813,-17.644022],[-186.679688,6.664608],[-223.242188,-55.37911],[-133.945313,17.978733],[-136.757813,62.431074],[-236.601563,57.891497]]]}}");
L.geoJSON(data,{
instead of L.Proj.geoJson(features, {
this.map.on("layeradd", this._layerAdded, this),
This should not be a problem, also it is working for me
do you think pointToLayer needs to be changed as I'm using L.circle and L.marker?
this should also make no problems.
Can you please set a break point / debug point here:
this.throttledReInitEdit || (this.throttledReInitEdit = L.Util.throttle(this.handleLayerAdditionInGlobalEditMode, 100, this)),
this._addedLayers = [],
this.map.on("layeradd", this._layerAdded, this),
is the new debug point called when you enable edit mode?
After enableing the edit mode check in the console if the map has the array:
map.pm._addedLayers
Can you please try to use
var data = JSON.parse("{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[-236.601563,57.891497],[-193.007813,14.264383],[-260.507813,-17.644022],[-186.679688,6.664608],[-223.242188,-55.37911],[-133.945313,17.978733],[-136.757813,62.431074],[-236.601563,57.891497]]]}}"); L.geoJSON(data,{
instead of
L.Proj.geoJson(features, {
sorry this coordinates are outside of our map. we use OS UK map.
What are the center of your map? map.getCenter()
What are the center of your map?
map.getCenter()
E:278657 | N:187307
It's not possible for me to convert this into latlng, which crs system are you using? It should be possible to get the center in latlng or not? Have your tried the debug steps?
I'm now AFK but I think im lastest in 40mins back
It's not possible for me to convert this into latlng, which crs system are you using? It should be possible to get the center in latlng or not? Have your tried the debug steps?
I'm now AFK but I think im lastest in 40mins back
here is the lat/lng for those values 51.571534 , -3.7522848
this.map.on("layeradd", this._layerAdded, this),
This should not be a problem, also it is working for me
do you think pointToLayer needs to be changed as I'm using L.circle and L.marker?
this should also make no problems.
Can you please set a break point / debug point here:
this.throttledReInitEdit || (this.throttledReInitEdit = L.Util.throttle(this.handleLayerAdditionInGlobalEditMode, 100, this)), this._addedLayers = [], this.map.on("layeradd", this._layerAdded, this),
is the new debug point called when you enable edit mode?
After enableing the edit mode check in the console if the map has the array:
map.pm._addedLayers
yes I've set a break point but the pointer doesn't come over there
I don't know whether it is a problem for the library but i just want to highlight one more point here that all my code is within self invoking function like below
(function (gisenq) {
code is here....
})(gisenq);
would you like to have a hangout call?
Yes send me please the invite link to design.falke@gmail.com
The error was because of the PMLock library.
@CityBelfast it'is fixed now: https://raw.githubusercontent.com/Falke-Design/PMLock/master/js/pmLock.js
The error was because of the PMLock library.
@CityBelfast it'is fixed now: https://raw.githubusercontent.com/Falke-Design/PMLock/master/js/pmLock.js
Thank you so much
Hi, I'm getting error when I do the following steps with geoman drawing tool.
https://user-images.githubusercontent.com/76213912/104944720-86c2e300-59af-11eb-84e6-58b2617cc596.MOV