Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
A little while back, I posted a few mapping extensions that read in various kinds of data to allow mapping of regions and data on Google Maps. One major problem with those is that Google is now charging money for useof their mapping product, so in order to use this extension on any grand scale,they'd need to purchase licensing.
So, in response to this, I've built an extension which uses all open source (free) products to provide some similar mapping capabilities(and then some). The tool which provides the scrolling and "slippy" map features is called OpenLayers which reads in map imagery from OpenStreetMap. What I've done this time, however, is built the extension to read in KML files for the regions. KML is a format that is very common in the industry (Google Earth uses and creates the files) ,and there are many tools out there to convert other formats (like shape files) into the KML format.
So, for example, I went and found a KML file for the US 50 states and put it into this new extension, and was able to create a map similar to my other US Map extension:
New Features
Above and beyond the normal features of the extensions I created for Google, this extension provides a few new features:
I've attached the extension as well as a QVW and quick guide. In the extension is a sample KML file called us_states.kml that can be used with the example QVW.
Please let me know if you have any questions. Hopefully this is useful to people.
Due to some issues with versions of Internet Explorer prior to 9 and how it handles different data formats, it is now necessary to change the KML file into an XML file prior to loading it into the extension. So, for example, if you have a KML named "counties.kml" you need to change the file extension so it becomes "counties.xml". Hopefully I'll eventually get time so this last step can be avoided, but for now it's necessary in order for the extension to work in IE8.
I've updated the attatchments on this post to use an XML file, so the examples should now work.
Thanks,
I didn't notice you had remarked that already.
I'm updating IE and QV and giving it a try.
Btw, I tried to add some more layers to your example but it seems like I can't add any new buttons to the controls (the layer wasn't showing anyway but it could be IE8)
Have you got any hints?
Francesco
P.S.: IE 9 works like a charm.
Messaggio modificato da Francesco Menin
I've been trying to use a different XML file to get data into the map.
It seems like I can't get past the
if ($.isEmptyObject(kmlJSON)) {
$.ajax({
url: KMLFile,
type: "GET",
success: function(data){
point in the script.js... I tried to change the SetItUp() function to reflect my XML fields but it seems like there is no particular set working.
Is there a particular file format I need?
UPDATE
Is it possible that the kmlJSON object doesn't get empty on refresh?
Thanks
This particular extension needs to have the data in kml format.
Thanks for a great extension.
I’m trying to get it to work with colormix1() but it returns a ARGB value. And with my basic QV skills I don’t know how to convert it t oRGB. Is there a way to convert or use ARGB to get gradient colors?
Btw whereis the donate button
Cheers
Hi Brian,
I'm sorry I didn't make myself clear
I actually created a KML file but it seems to me that the
$.ajax({
url: KMLFile,
type: "GET",
success: function(data){
won't load my file. I actually copied your function in a new one to collect my data in a different Layer so I could try and change different properties. I can tell that I can't get to this point because I tried moving the
var layerVector = new OpenLayers.Layer.Vector( "KML" );
part right after the start of the if() and before the $.ajax request. My KML file is in the same place as is yours so I'm wondering what could be stopping it from getting the data.
Thanks
Francesco
Hi Brian,
I'm unable to view the map after opening the QV document. I have copied the openlayers folder to
C:\Program Files\QlikView\Examples\Extensions\openlayers
I'm running on Windows7 with x64 OS. I'm sure if I'm missing something very simple.
Thanks in advance.
Cheers - DV
Hi DV
I belive it should be in C:\Users\YOURUSER\AppData\Local\QlikTech\QlikView\Extensions\Objects
DV,
You may also want to check Transparency on the object. You can find this on your Colors tab and many times this gets set to 100% (especially after upgrade). Setting to 0 should show the map.
Mike
Hi people,
First congrats for the extension. Its very usefull.
Can anyone just say how to put colours on top of regions?
It may be a simple question but using the doc that comes on the extension i could not understand.
Thanks,
Eliano
Hi people,
First congrats for the extension. Its very usefull.
Can anyone just say how to put colours on top of regions?
It may be a simple question but using the doc that comes on the extension i could not understand.
Thanks,
Eliano