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.
thx, this answer:
should be pinned in some way, or make an edit line in the originally post.
Should the colorexpression always be like if greater than then RGB(...)?
Hi Brian and excellent work... I'm working on adding additional functionality to the extension, and I have a problem. I'm new to extension development, so it's probably very straightforward...
I added a new Measure to the Definition.xml file, as well as to the MyProperties file. But the array in the script.js file still has the same number of columns, and the value in the Dialog in QV is not even stored - refreshing the page clears the new field.
The question: how can I let the extension know there is a fourth Measure (or a 5th column to be fetched from QlikView in the Data structure)?
---
Let me explain why I'm trying to do that...
I'm working with a fairly extensive set of KML files where features are ID'd by a code (for example, an ISO region code, as opposed to its name). I have both IdRegion and RegionName in my datamodel.
Setting the Region as the dimension does not work since the KML contains codes. Using IdRegion works... but when a selection is made on the map, it's the IdRegion that appears in the Current Selection Box. This is meaningless for the user.
I tried loading the Region field as a dual, and using a calculated dimension (like so: ="right("0" & num(Region), 5)"). Selection kind of works, but multiselection does not. I could not find the reason or solve it.
I think this can be a common problem, so I think adding another Measure "KML feature id". This would allow us to use Region as a Dimension, while specifying another field to use as a linking code in the KML. If empty, this should still use the Dimension value.
I'd do it and push it on GitHub... if only I could get the new Measure to work
Hi Jordi,
Simply drop the existing object and recreate it. The new object will reflect the changes in the definition file.
Hi @Borja Rodriguez,
I'm trying to make a map with this Extension for regions from Madrid but altought Im adding on '.xml' file the "polygon id" which didn't appear I don't be able to get the map show any form, polygon or just something.
Could u explain how tuned your file to get your Map from Catalonia regions?
Thank you so much.
P.D: Thanks to @Brian Munz for improve our Qlik Community with their great extensions.
P.D.2: Sorry about my question, I didnt read that its necesary download and install the lastest extension (quick map), since I done I can see regions of Spain, now I only need a complete kml to show what I need.
Again Thank you all for work, help and make bigger Qlik Community.
Hi Brian
Thanks for the Mapping object, it works good.
However i am having an issue when trying to load regions on it.
I am getting an error when i am trying to map the states for India. The issue comes when i try to select all the states. I feel there is a limit to the number of polygons that can be loaded on the map.
Please let me know if that is the case and how i can tackle that.
Below is the error msg i get
thanks in advance.
Hi, I really like this. Just watning to know if someone can help, chaing this from polygons to linestrings. I am looking to generate a roadnetwork and it would be great to visualise this instead and have each road segment selectable.
One minor thing which troubled me to load the US maps correctly was in the Script.js, I had to change the URL to OpenLayers.
Replace all the "http:" references to "https:" and strip off the "www." from url
Example: --> https://openlayers.org/api/OpenLayers.js
Thank you!