Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a little challenge with extensions. I am trying to include the GoogleMaps API. I know the solution on static maps but this is not satisfaying enough for my needs. Therefore I thought about writing my own extension. But for some reason I can't get it working. The below is a simplified extract, which simply loads the JS script from Google and then should create an object based on the Google API. Unfortunately, the execution stops after the alert("in") statement. I believe the latlng object can't be created because the Google Javascript is unknown (although loaded before).
Any ideas? Here is the code...
Qva.AddExtension('GoogleMaps', function() {
var script = document.createElement("script")
script.setAttribute("type", "text/javascript");
script.setAttribute("src", "http://maps.google.com/maps/api/js?sensor=true");
this.Element.appendChild(script);
script = document.createElement("script");
script.setAttribute("type", "text/javascript");
this.Element.appendChild(script);
alert (this.Element.innerHTML);
initialize();
});
function initialize() {
alert ("in");
var latlng = new google.maps.LatLng(48, 8);
alert(latlng);
var myOptions = {
zoom: 4,
center: latlng,
mapTypeId: google.maps.MapTypeId.SATELLITE
};
}
cheers
Florian
Florian
Did you get this working as I have jsut started to look at the same thing? I don't really understand javascript at the moment so i'm learning it as i go along
Regards
Lewis
Here's a sample of integrating Google Maps JavaScript v3 API into QlikView.
http://andpointsbeyond.com/2011/06/24/qlikview-google-maps-javascript-v3-integration/
Jay
Thats brilliant thanks - that will give me something to work from - next stop Dummies guide for JavaScript!
Thanks
Lewis
Hi,
I get an error when I try to use this. An image of the map shows fine but when I try to go into properties and select layout or anything an error message pops up with the message Error: 'style' is null or not an object
Any ideas?
Also, once you've got the map, how do you go about showing data points on it?
Thanks,
Emma
Hi Jay!
was wondering if you got the map integrated with your datamodel in QV?
would like to dynamically load data points onto the map.
best,
Brad