Map element, Google maps, WMS and more (Jaspersoft Studio 5.5.2)

Hello. I'm working on some reports, where I want to use the map element, and locate some events with markers. I've got a few questions that I have not found previously answered:

* Google maps is great, but I'd like to replace their maps with some others, via a WMS server with cartography better suited for the report's goals. Is there an easy way of doing this?

* As I said, I must locate a few events (latitude, longitude) on the map. I need to adjust zoom level and the center of the map based on the latitude and longitude of these events, and since they can be quite disperse, I cannot fix a static center and zoom level, they need to be adjusted depending on the result of th SQL query that feeds the report.

Thanks in advance for your replies.

Best regards.

jonay.santana's picture
Joined: Mar 12 2013 - 10:58am
Last seen: 7 years 7 months ago

Hello all. I'm working on a report that shows some information about geolocalized events. I used to work with the "Map" element, but since it only works with Google Maps, I had to switch to a custom WMS server (due to licensing issues).

The only way I have to show a map within a report is using the "Image" element, and setting its expression string to the WMS generated image. That string, entered in a browser window, works flawlessly. But as soon as I enter it on Jaspersoft Studio, the whole environment becames unstable. It hangs for 10 to 15 seconds, responds briefly for 1 to 3 seconds, and hangs again.

It seems that Jasper is fetching the image from the WMS server in a loop, not giving the WMS enough time to generate and send the image. Even before the WMS server has send the image, Jasper asks again for it, again and again. I've checked the logs from the server, and Jasper keeps asking for the image every five seconds or so.

Is there any way to force Jaspersoft Studio Community 6.0.4 to NOT fetch the image until previewing the report? I don't mind seeing the image while I'm working, as soon as it is displayed when the report asks for it.

Thanks in advance, best regards.


jonay.santana - 8 years 4 months ago


You should probably post this to a new question.  It won't be easily found buried in this old question.

djohnson53 - 8 years 4 months ago

3 Answers:

currently the Map component is using the Google Maps and it is meant to work with it. 
See here from the official JR documentation:
Quoting: The JR built-in map component is based on the public Google Maps APIs licensed under the Creative Commons Attribution 3.0 License. Prior to start using this component, please consult both Google terms of service and Google site policies pages. Ensure the map component in your application is used in accordance with these terms and conditions

If you want to use another map provider you should create a more generic and custom map component. This needs to be done first at JR level and later at JSS level where you need to provide a dedicated plugin for it.

I don't know which kind of modifications you put in place in order to visualize a different map, anyhow it is not safe or supported because a lot of stuff will not work indeed.

You should open an enhancement request in the JasperReports Tracker in order to ask for a more generic component.
Anyhow this is not an easy task to produce something "generic" that allows you to use markers and paths on different map types. Plus another important aspect to consider is the legal agreement that should exist in order to integrate such kind of components.

If you look for example in the "Authentication" tab there are some configuration information related to Business usage of the Map component itself.
More information about it can be found here:

About your second question, you can use for latitude and longitude (and other info) dedicated fields extracted from a DB query. If you look at the properties tab you will see that the value can be an Expression.


mrabbi's picture
Joined: Oct 31 2011 - 9:20am
Last seen: 2 days 11 hours ago

Developing reports in Studio directly is typically done by initializing your report and using the Elements in the Palette to build out your report.  I don't see an element for the EMS server functions.  Maybe contact the vendor directly and see if they have anything for Jaspersoft Studio.  Some vendors offer libraries that can be dropped into Studio, sometimes for a cost however.  I don't believe that what you are trying to do can be done easily, but I could be wrong.  Maybe someone else can help out... 

H Mendoza's picture
Joined: Feb 20 2013 - 11:39am
Last seen: 4 years 3 months ago

Hello, Hugo, thanks for your reply.

It's true that there is no element in Jaspersoft Studio's Palette for WMS maps, but I've been able to provide the URL of a WMS server with some modifications to display the map I'd like to include in the report. But I cannot draw pointers on a picture. And I cannot (or at least, I have not) found a way to leave Google Maps aside and use another map server, be it Bing, Yahoo, Openstreetmap, or another (WMS).

I expected to select my map provider in Jaspersoft Studio, but it seems to be harder than I thought.

All feedback welcome.


Best regards.


jonay.santana's picture
Joined: Mar 12 2013 - 10:58am
Last seen: 7 years 7 months ago