Puzzled at v-leaflet-editable LEditable behaviour/warning message

My understanding is that if I want to create a LPolyline to display in a LMap and sometime later I want it to be editable then I do something like:

LMap lMap = new LMap();
lMap.setCustomInitOption("editable", true);
lMap.addLayer(new LTileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"));

LPolyline lPolyline = new LPolyline(new Point(40, -10), new Point(70, 0), new Point(40, 10));
lPolyline.setImmediate(true);
lMap.addComponent(lPolyline);  // Displays

// Time passes........

LEditable lEditable = new LEditable(lPolyline); // Make it editable

My puzzlement is about when the lPolyline stops being editable; do I have any programmatic control over that?

The reason I ask is that I also display some LCircleMarkers that have popups defined for them and when I click on one of them (nowhere near the editable polyline) to display the popup after the LPolyline has been modified a FeatureModifiedEvent for that LPolyline is fired and the LPolyline stops being editable.

This event is also fired and the LPolyline stops being editable when I click on the edited LPolyline itself or elsewhere in the map and the following error message is displayed:




Warning: RPC call to org.vaadin.addon.leaflet.editable.client.EditableServerRcp.vectorModified received for connector XX but no such connector could be found. Resynchronizing client.


Does anyone have any ideas?

Warwick

Hi,

Do you have a test case for this issue (simple project where I could reproduce this or a
class to the project
? I wasn’t able to re-produce it. Which versions (V-Leaflet & v-leaflet-editable) are you using?

cheers,
matti

Hi Matti,

I have attached a whole project (LeafletEditableMapComponent2.java is the crucial bit of source) in a 7-zip file which I can build/deploy straight from NetBeans on Glassfish 4.1. I use version 1.0.0-b1 (the latest I believe) of v-leaflet-editable and let v-leaflet be pulled in by transitive dependency. The results of doing a ‘mvn dependency:tree’ are given at the end of this message.

To reproduce the RPC call warning follow the steps below:

  1. Zoom in on the polyline a bit.
  2. Click ‘Start Editing’ button.
  3. Click ‘Stop Editing’ button.
  4. Click ‘Start Editing’ button again.
  5. Insert a point in one of the two legs of the polyline.
  6. Click elsewhere in the map

I have worked around the LPolyline stopping being editable when a marker is clicked by re-enabling it in the FeatureModifiedEvent Listener but it’s not ideal.

Regards,

Warwick



[INFO]
— maven-dependency-plugin:2.1:tree (default-cli) @ VaadinVLeafletLEditableIssue —
[INFO]
com.chthonics.vaadin.issues:VaadinVLeafletLEditableIssue:war:1.0-SNAPSHOT
[INFO]
± org.vaadin.addon:v-leaflet-editable:jar:1.0.0-b1:compile
[INFO]
| ± org.vaadin.addon:v-leaflet:jar:1.0.0-b1:compile
[INFO]
| | ± org.peimari:g-leaflet:jar:1.0.0-b1:compile
[INFO]
| | - com.vividsolutions:jts:jar:1.13:compile
[INFO]
| ± org.peimari:g-leaflet-editable:jar:1.0.0-b1:compile
[INFO]
| | ± javax.validation:validation-api:jar:1.0.0.GA:compile
[INFO]
| | ± javax.validation:validation-api:jar:sources:1.0.0.GA:compile
[INFO]
| | ± org.slf4j:slf4j-api:jar:1.6.2:compile
[INFO]
| | - org.slf4j:slf4j-simple:jar:1.7.2:compile
[INFO]
| ± com.fasterxml.jackson.core:jackson-databind:jar:2.3.2:compile
[INFO]
| | ± com.fasterxml.jackson.core:jackson-annotations:jar:2.3.0:compile
[INFO]
| | - com.fasterxml.jackson.core:jackson-core:jar:2.3.2:compile
[INFO]
| ± org.geotools:gt-api:jar:10.2:compile
[INFO]
| | - javax.media:jai_core:jar:1.1.3:compile
[INFO]
| ± org.geotools:gt-geojson:jar:10.2:compile
[INFO]
| | ± org.geotools:gt-main:jar:10.2:compile
[INFO]
| | - com.googlecode.json-simple:json-simple:jar:1.1:compile
[INFO]
| ± org.geotools:gt-referencing:jar:10.2:compile
[INFO]
| | ± java3d:vecmath:jar:1.3.2:compile
[INFO]
| | ± commons-pool:commons-pool:jar:1.5.4:compile
[INFO]
| | ± org.geotools:gt-metadata:jar:10.2:compile
[INFO]
| | | - org.geotools:gt-opengis:jar:10.2:compile
[INFO]
| | | - net.java.dev.jsr-275:jsr-275:jar:1.0-beta-2:compile
[INFO]
| | - jgridshift:jgridshift:jar:1.0:compile
[INFO]
| ± org.geotools:gt-epsg-hsql:jar:10.2:compile
[INFO]
| | - hsqldb:hsqldb:jar:1.8.0.7:compile
[INFO]
| ± org.geotools:gt-epsg-extension:jar:10.2:compile
[INFO]
| - org.geotools:gt-shapefile:jar:10.2:compile
[INFO]
| ± org.geotools:gt-data:jar:10.2:compile
[INFO]
| - jdom:jdom:jar:1.0:compile
[INFO]
± javax.servlet:javax.servlet-api:jar:3.0.1:provided
[INFO]
± com.vaadin:vaadin-server:jar:7.5.6:compile
[INFO]
| ± com.vaadin:vaadin-sass-compiler:jar:0.9.12:compile
[INFO]
| | ± org.w3c.css:sac:jar:1.3:compile
[INFO]
| | - com.vaadin.external.flute:flute:jar:1.3.0.gg2:compile
[INFO]
| ± com.vaadin:vaadin-shared:jar:7.5.6:compile
[INFO]
| | ± com.vaadin.external.streamhtmlparser:streamhtmlparser-jsilver:jar:0.0.10.vaadin1:compile
[INFO]
| | - com.vaadin.external.google:guava:jar:16.0.1.vaadin1:compile
[INFO]
| - org.jsoup:jsoup:jar:1.8.1:compile
[INFO]
± com.vaadin:vaadin-push:jar:7.5.6:compile
[INFO]
| - com.vaadin.external.atmosphere:atmosphere-runtime:jar:2.2.7.vaadin1:compile
[INFO]
| - com.vaadin.external.slf4j:vaadin-slf4j-jdk14:jar:1.6.1:compile
[INFO]
± com.vaadin:vaadin-client:jar:7.5.6:provided
[INFO]
± com.vaadin:vaadin-client-compiler:jar:7.5.6:provided
[INFO]
| ± commons-collections:commons-collections:jar:3.1:provided
[INFO]
| ± commons-logging:commons-logging:jar:1.1.3:provided
[INFO]
| ± ant:ant:jar:1.6.5:provided
[INFO]
| ± net.sourceforge.cssparser:cssparser:jar:0.9.11:provided
[INFO]
| ± ant:ant-launcher:jar:1.6.5:provided
[INFO]
| ± org.ow2.asm:asm:jar:5.0.3:provided
[INFO]
| ± org.ow2.asm:asm-util:jar:5.0.3:provided
[INFO]
| | - org.ow2.asm:asm-tree:jar:5.0.3:provided
[INFO]
| ± org.ow2.asm:asm-commons:jar:5.0.3:provided
[INFO]
| ± org.eclipse.jetty:jetty-annotations:jar:8.1.12.v20130726:provided
[INFO]
| | ± org.eclipse.jetty:jetty-plus:jar:8.1.12.v20130726:provided
[INFO]
| | | ± org.eclipse.jetty.orbit:javax.transaction:jar:1.1.1.v201105210645:provided
[INFO]
| | | - org.eclipse.jetty:jetty-jndi:jar:8.1.12.v20130726:provided
[INFO]
| | | ± org.eclipse.jetty:jetty-server:jar:8.1.12.v20130726:provided
[INFO]
| | | | - org.eclipse.jetty.orbit:javax.servlet:jar:3.0.0.v201112011016:provided
[INFO]
| | | - org.eclipse.jetty.orbit:javax.mail.glassfish:jar:1.4.1.v201005082020:provided
[INFO]
| | | - org.eclipse.jetty.orbit:javax.activation:jar:1.1.0.v201105071233:provided
[INFO]
| | ± org.eclipse.jetty:jetty-webapp:jar:8.1.12.v20130726:provided
[INFO]
| | | ± org.eclipse.jetty:jetty-xml:jar:8.1.12.v20130726:provided
[INFO]
| | | - org.eclipse.jetty:jetty-servlet:jar:8.1.12.v20130726:provided
[INFO]
| | | - org.eclipse.jetty:jetty-security:jar:8.1.12.v20130726:provided
[INFO]
| | ± org.eclipse.jetty.orbit:javax.annotation:jar:1.1.0.v201108011116:provided
[INFO]
| | - org.eclipse.jetty.orbit:org.objectweb.asm:jar:3.1.0.v200803061910:provided
[INFO]
| ± org.eclipse.jetty:jetty-servlets:jar:8.1.12.v20130726:provided
[INFO]
| | ± org.eclipse.jetty:jetty-continuation:jar:8.1.12.v20130726:provided
[INFO]
| | - org.eclipse.jetty:jetty-client:jar:8.1.12.v20130726:provided
[INFO]
| | - org.eclipse.jetty:jetty-http:jar:8.1.12.v20130726:provided
[INFO]
| | - org.eclipse.jetty:jetty-io:jar:8.1.12.v20130726:provided
[INFO]
| ± org.eclipse.jetty:jetty-util:jar:8.1.12.v20130726:provided
[INFO]
| ± org.jdesktop:swing-worker:jar:1.1:provided
[INFO]
| ± commons-codec:commons-codec:jar:1.8:provided
[INFO]
| ± commons-io:commons-io:jar:2.4:provided
[INFO]
| ± org.apache.commons:commons-lang3:jar:3.1:provided
[INFO]
| ± org.apache.james:apache-mime4j:jar:0.6:provided
[INFO]
| ± org.apache.httpcomponents:httpclient:jar:4.3.1:provided
[INFO]
| ± org.apache.httpcomponents:httpcore:jar:4.3:provided
[INFO]
| ± org.apache.httpcomponents:httpmime:jar:4.3.1:provided
[INFO]
| ± net.sourceforge.nekohtml:nekohtml:jar:1.9.19:provided
[INFO]
| ± xalan:serializer:jar:2.7.1:provided
[INFO]
| ± xerces:xercesImpl:jar:2.11.0:provided
[INFO]
| ± xml-apis:xml-apis:jar:1.4.01:provided
[INFO]
| ± com.ibm.icu:icu4j:jar:50.1.1:provided
[INFO]
| - com.vaadin:vaadin-client-compiler-deps:jar:1.2.0:provided
[INFO]
- com.vaadin:vaadin-themes:jar:7.5.6:compile

21907.zip (27.1 KB)

Thanks to your perfect test case, I
nailed it
. The listeners was never cleared when removing editing extension. I’ll try to create a new release of both v-leaflet and v-leaflet-editable next week.

cheers,
matti

Hi,

Glad you sorted it. I presume your mods will stop the RPC call warning being thrown. Do you have any info, or can you point me at any docs regarding under what circumstances the editing of the polyline finishes and thus the FeatureModifiedEvent being sent? Is it correct that the editing stops when I click elsewhere in the map or on a marker?

Cheers,

Warwick

I have no idea actually what is the logic firing edited event (when the v-leaflet-editabla implementation de-registers itself). “Fired as soon as any change is made to the feature geometry” stated
in the project page
, but have no idea what that means. It might be that some other event would be more appropriate for this use case.

cheers,
matti

Matti, your link to the project page in your last post only seems to go to the top level Vaadin forum page, is that what you intended?

Warwick

Don’t worry, I think you meant here:
https://github.com/Leaflet/Leaflet.Editable

Warwick