Open russellhoff opened 9 years ago
Currently the component is printing the body element. It would be possible to adjust it, once it will be ready I will share it.
Thanks @mikrop !!
Added option to print only element with the map.
@russellhoff The new version is uploaded to Vaadin repository.
After upgrading to the new version, an error has cropped up in this line: LEasyPrint easyPrint = new LEasyPrint();
This is the stack trace:
java.lang.NoClassDefFoundError: org/vaadin/addon/leaflet/client/LeafletControlState
at com.ingartek.cavwebapp.view.administrador.verplan.ComponenteVerPlanMapa.setupMapaL(ComponenteVerPlanMapa.java:320)
at com.ingartek.cavwebapp.view.administrador.verplan.ComponenteVerPlanMapa.
@russellhoff I still prefer the version to 1.1.1 once repackaged Please update to this. Note: To define an element that will be printed
LMap leafletMap = new LMap();
leafletMap.addBaseLayer(new LOpenStreetMapLayer(), "OSM");
leafletMap.setId(MAP_ID);
LEasyPrint easyPrint = new LEasyPrint();
easyPrint.setId(leafletMap.getId());
leafletMap.addControl(easyPrint);
@mikrop my project crashes when I construct a LEasyPrint object instance :(
In the following line:
LEasyPrint easyPrint = new LEasyPrint();
the next stack trace:
jun 25, 2015 5:14:07 PM com.vaadin.server.DefaultErrorHandler doDefault
GRAVE:
java.lang.NoClassDefFoundError: org/vaadin/addon/leaflet/client/LeafletControlState
at com.ingartek.cavwebapp.view.administrador.verplan.ComponenteVerPlanMapa.setupMapaL(ComponenteVerPlanMapa.java:307)
at com.ingartek.cavwebapp.view.administrador.verplan.ComponenteVerPlanMapa.
Hello.
I have been also trying to use EasyPrint 1.1.1 with the latest Leaflet and I also still get this exception:
com.vaadin.server.ServiceException: java.lang.NoClassDefFoundError: org/vaadin/addon/leaflet/client/LeafletControlState com.vaadin.server.VaadinService.handleExceptionDuringRequest(VaadinService.java:1463) com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1420) com.vaadin.server.VaadinServlet.service(VaadinServlet.java:350) javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
For me, only version 1.0.0 works.
Hey @russellhoff, @mbasa,
class is the artifact org.vaadin.addon.leaflet.client.LeafletControlState
<dependency>
<groupId>org.vaadin.addon</groupId>
<artifactId>v-leaflet</artifactId>
<version>0.5.7</version>
</dependency>
what version you have registered in the dependencies? I've added a new module springboot-easyprint (https://github.com/mikrop/v-leaflet-easyprint-parent) that contains a small application where everything works.
Hi @mikrop
I'm implementing the v-leaftlet-easyprint add-on with the latest version of v-leaflet (1.0.0) and vaadin 7.7.3.
When i run the command to package the project, i'm retrieving this error.
[INFO] --- vaadin-maven-plugin:7.7.3:compile (default) @ proj-widgetset ---
[INFO] auto discovered modules com.proj.presentation.AppWidgetSet]
[INFO] Compiling module com.proj.presentation.AppWidgetSet
[INFO] Tracing compile failure path for type 'org.vaadin.addon.leaflet.easyprint.client.LeafletEasyPrintState'
[INFO] [ERROR] Errors in 'jar:file:/Users/user/.m2/repository/org/vaadin/addons/v-leaflet-easyprint/1.1.1/v-leaflet-easyprint-1.1.1.jar!/org/vaadin/addon/leaflet/easyprint/client/LeafletEasyPrintState.java'
[INFO] [ERROR] Line 3: The import org.vaadin.addon.leaflet.client.LeafletControlState cannot be resolved
[INFO] [ERROR] Line 5: LeafletControlState cannot be resolved to a type
[INFO] Tracing compile failure path for type 'org.vaadin.addon.leaflet.easyprint.client.LeafletEasyPrintConnector'
[INFO] [ERROR] Errors in 'jar:file:/Users/user/.m2/repository/org/vaadin/addons/v-leaflet-easyprint/1.1.1/v-leaflet-easyprint-1.1.1.jar!/org/vaadin/addon/leaflet/easyprint/client/LeafletEasyPrintConnector.java'
[INFO] [ERROR] Line 32: Cannot cast from LeafletControlState to LeafletEasyPrintState
[INFO] [ERROR] Line 31: The return type is incompatible with AbstractControlConnector.getState()
[INFO] [ERROR] Errors in 'jar:file:/Users/user/.m2/repository/org/vaadin/addons/v-leaflet-easyprint/1.1.1/v-leaflet-easyprint-1.1.1.jar!/org/vaadin/addon/leaflet/easyprint/client/LeafletEasyPrintState.java'
[INFO] [ERROR] Line 3: The import org.vaadin.addon.leaflet.client.LeafletControlState cannot be resolved
[INFO] [ERROR] Line 5: LeafletControlState cannot be resolved to a type
[INFO] [ERROR] Aborting compile due to errors in some input files
[INFO] ------------------------------------------------------------------------
I want to print only the map passing the map id element, but i can't package to deploy the project.
How, i can use this feature?
Hi @ncabrerax
The latest release is https://vaadin.com/directory#!addon/v-leaflet-easyprint This version is stored in the repository:
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>v-leaflet-easyprint</artifactId>
<version>1.1.1</version>
</dependency>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
The latest version of leaflet-easyprint-parent-1.1.2-SNAPSHOT contains submodule springboot-easyprint as a sample application
Hi!
I've eventually finished adding the button to my map. This maps is held within several layouts: the map it's inside an horizontal layout splitting it into two parts, plus another layout.
The problem is that although the button is intended to print the map, when visualising the print preview there can be seen the whole screen.
What I want to print is the map, only. Is there any way to print the map only?