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.
currently the Map component is using the Google Maps and it is meant to work with it.
See here from the official JR documentation: http://jasperreports.sourceforge.net/sample.reference/map/index.html
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: https://developers.google.com/maps/documentation/business/webservices/
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.
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...
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.