Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Brian_Munz
Employee
Employee

New Geospatial Mapping Extensions using Google Maps

I've attached below some mapping extensions that I've been working on and 2 example QVWs for them.  I've gotten a lot of feedback lately that there is a great need for QlikView to keep up as far as mapping goes, especially in terms of regions and countries.  Strangely enough the data for different geographical regions is difficult to find (and the boundary lines are often suspect) and mapping  services like google maps, bing, etc. aren't yet smart enough to select regions based on name.  Instead, polygons need to be drawn overtop of the maps based on a series of longitude, latitude coordinates or polylines.  These shapes will then render overtop of the given regions and represent them allowing us to shade and color them to represent data in different ways.

So, based on the data I was able to find for free out there and the specific needs requested by some people in the field, I created world map and US map extensions.  The US map extension was essentially an attempt to render the SVG Heat Map I built for the v11 Extension Examples document (http://demo.qlik.com/detail.aspx?appName=Extension%20Examples.qvw)within google maps:

US MAP.png

The data for the state regions is contained within the extension itself, but of course an internet connection is needed to use google maps. 

The world map extension was built for a specific request I had gotten to modify the SVG map example to allow for more than 2 colors and make a version of that extension that works for the world map:

world map.png

As you can see, this uses the map as a sort of traffic light gauge which colors the countries based on a range of data.

The properties panel for both of these extensions is pretty straightforward and should be a lot more flexible than the SVG map extension:

properties.png

Here is a quick guide to the properties:

Country/State: Obviously this should be set to the dimension holding the country or state names.  If the name doesn't match up to the name within the extension data, the connection will not be made, so if a given country isn't rendering on the map, that's probably why. 

Percentage: This expression controls the opacity (or alpha) of the different regions.  So, for example, a value of 70 on a given country will cause it to show at 70% opacity.  So this can either be set to something static (like above) where all countries will render with a certain opacity, or it can be set to an expression where regions are made to be lighter and darker opacity based on a data value (similar to the US map shown above).

Color Expression: This expression will provide the color(s) to use in rendering the regions.  Again, if only one color is desired, you could simply set this to a Hex or RGB value and all regions would show up the same color.  If you wanted to create a gauge type visualization like shown on the world map above, you could set that up in the expression as well.  For example, for the world map shown above where the traffic light colors are displayed based on population, the expression is:

=If(population > 100000000,'#439400', If(population > 30000000, '#F2EF1B', If(population <= 30000000,'#EB1A1A')))

This allows a lot of flexibility as far as which colors to display, how many, and when.

Hot Color: This is simply a color picker to use if a color expression is more than you need.  If the color expression field is left blank, the Hot Color choice will be used.

Map Start Point: This is the latitude and longitude value that the map should default to.  Currently the default is to show the United states, but if you wanted to change this, simply point it to somewhere else as the default, listing latitude first, then longitude.

Map Zoom Value: This value changes how zoomed in or out you want the map to display by default.  As you resize the extension you may find you need to zoom in or out, so this is where you would make that change.

Lastly, there are a few other quick things to mention about these extensions:

  • I tested having multiple instances of the extension on one sheet and it works fine, so that should be good to go
  • There is a button in the upper right that I added which allows the user to turn region labels on or off on the map.
  • Currently, clicking on a region will select that region in the QVW, but as I was building it I tested out creating some popup boxes on click, so that's fairly easy to do with a little javascript.
  • I haven't tested these in QV10, but I have no reason to think they wouldn't work.

I tried to comment the code as best as I could and if it seems as if these extensions are useful, I was thinking I might provide some in depth documentation on how to implement something similar for other regions.

That's about it.  It should hopefully be fairly easy to implement.  Let me know if you have any questions, and I hope this is useful to someone!

UPDATE:   I noticed that the extensions weren't working in IE7, so I made changes to them so they should now work.  The latest versions are now attached to this message so please download again for the latest.

41 Replies
Brian_Munz
Employee
Employee
Author

FYI, I've just posted an extension which uses OpenLayers and OpenStreetMap (both of which are free) to do this kindof mapping:

http://community.qlik.com/message/181821#181821

It loads in KML files, allowing for custom (or any other kind of) regions.

Not applicable

Hey Brian,

this is amazing..

I have a report with State List Box. and I am trying to add USA Map ..

Is there any instruction on how to do add the map there and how can I connect it to the state Field that I have.

Thanks

Not applicable

Hi Bryan,

I tried to use your US Map extension for getting different shades of color density for my Net Sales % expression according to States. Seems the extension works easily for simple and direct calculations. As the Net Sales % expression is little complex, I cannot see the data even showing up for this expression.

=The Net Sales % expression used is:

SUM({$<[Year-Quarter] = {$(=ONLY([Year-Quarter])) }>}Sales) / SUM({$<[Year-Quarter] = {$(=ONLY([Year-Quarter])) }>} Total Sales)

Let me know how I can proceed ahead.

Not applicable

Hi,

  We are using this extension in our application. But for one user, the extension 'Sorry. No imagery Here'. He gets a popup blocker when he accesses the app. any browser settings we need to take care of?

Not applicable

Hi Brian, very interesting Topic indeed but there are many technical limitations using Google Maps (GMaps) to display QlikView KPI indicators. Indeed, you cannot display several indicators at the same time and on the same map (background + foreground indicators), you are also limited to bubbles and therefore cannot display pie/bar charts nor "real" heat maps. On top of that, you cannot display QlikView KPIs on specific Sales/Business Areas with GMaps such as the Bricks in the Pharmaceutical sector (Brick = aggregation of zipcodes).

Moreover, there are also a few "commercial" aspects to be considered since many QlikView customers & channel partners use GMaps API "FREE" Key inside their QlikView server or rich client without complying with GMaps license terms...Indeed, for "professional internal use" (intranet, extranet or internet with username/password authentication to QlikView application), you must buy GMaps API "Premier" which costs about 10,000 $ USD per year or 8,500 euros per year + possible extra fees depending upon the total number of daily hits.

A few alternatives exist such as Open Street Map (totally FREE) or other WMS/TMS services. I suggest you to have a look at our new mapping extension for QlikView 11 SR1 namely "GeoQlik v11.6":

http://www.geoqlik.com/en/geoqlik-for-qlikview/geoqlik-v11.html

Please find hereafter a few screenshots of GeoQlik V11.6 using WMS/TMS services to display QlikView KPIs:

geoqlik_v11_demo_1.JPGgeoqlik_v11_demo_2.JPGgeoqlik_v11_demo_3.JPGgeoqlik_v11_full.jpg

Not applicable

Hey,

Thanks for creating such a helpful Map Extension for Qlikview.

Actually I was trying to use the Extension with my data. But I am not able to see the colors in the US Map.

I took the same app and uploaded my data having no change in settings except the field in Expression.

I am now unable to troubleshoot the issue. Everything seems to be fine, but colors are not coming in the chart.

But in your application it is working perfectly fine.

I would appreciate suggestions from you.

Regards,

Neelam

Brian_Munz
Employee
Employee
Author

Could you please post your expression?

Thanks.

Not applicable

MExican Maps ??? You can send your excel tab??? thanks

Cheers

Not applicable

Ok, silly question. I have a data set (Excel) that consists of election results:

  • Election Type
  • State
  • Position/Seat
  • Candidate Name
  • Candidate Party
  • Candidate Vote Percent
  • Notes

How can I use this extension to allow uses to click on a state and see the election results for that state?

Thanks!

Brian_Munz
Employee
Employee
Author

In a pop up or something like that?  Or to see all of the data on the sheet change to reflect that click?