Can Visualize.js display Map component (Google Map)

0

I can display charts with Visualize.js but when I select a report with a Map, the Map component is not displaying even though other elements in the report is being displayed.

Furthermore, the map component is showing when I view the report in Repository.

Does Visualize.js support displaying maps?

I'm currently using JasperReports Server 5.6.0.

hozawa's picture
53200
Joined: Apr 24 2010 - 4:31pm
Last seen: 5 months 1 week ago

1 Answer:

0

Yes it does, the thing is that Visualize will not autoload the Google Maps API, you will need to load it in your page. Somehting like this:

 
<script src="http://localhost:8080/jasperserver-pro/client/visualize.js"></script>
<script src="https://maps.googleapis.com/maps/api/js"></script>
<script> 
var mapReport = '/public/Samples/MyMapReport';
var MyReport;
 
visualize({
    auth: {
        name: "jasperadmin",
        password: "jasperadmin"
    }
}, function (v) {
 
    myreport = v.report({ 
            resource: mapReport, 
            container: "#container",
            params: { 
                "startMonth": [ 1 ],
                "endMonth" : [ 12 ]
            }
    });

marianol's picture
4788
Joined: Sep 13 2011 - 8:04am
Last seen: 1 year 1 month ago

Thanks. I've been able to view Google Map included in the report by adding
<script src="https://maps.googleapis.com/maps/api/js"></script>

I'm now able to go on with my Liferay Visualize.js portlet!
http://community.jaspersoft.com/questions/843965/liferay-portlet-based-v...

hozawa - 5 years 1 month ago
Feedback