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: 
Alexander_Thor
Employee
Employee

Google Maps - Marker

Google Maps Extension with Markers.

QlikTech takes no responsibility for any code and QlikTech Support Agreement does not cover issues with this extension.

Please review Googles license agreement before you put this into production.

Introduction

This is a QlikView extension object that integrates Google Maps Javascript API V3 into QlikView.

Load a set a coordinates into QlikView and visualize them together with this extension. This extension will plot every single data point as a marker on the map so if you have a large amount of markers please be aware that it might have some performance impact. If you are experiencing performance issues look into the cluster extension instead: http://community.qlik.com/message/325640

You can either use the extension 'as is' or use it as a base to further customize it to fit your needs.

Custom Markers

Added support for custom markers images. In the properties dialog you now have the option to specify a custom image.

You can either have a static image or let the expression evaluate one for you, for example:

=If(MyExpression > 1, 'http://image_for_true', 'http://image_for_false'). If you do not specify an url or enter an invalid one the extension will fallback to the standard marker.

Supported image extensions are bmp, jpg, jpeg, tiff, png and gif.

You can host the images through the qlikview webserver or through IIS.

marker.PNG

If you build something awesome please share it with the community!

Live long and prosper.

99 Replies
Alexander_Thor
Employee
Employee
Author

Hi Bruno,

No you can't use bundled images. You can load local files that resides on your hard drive but that should be avoided.

However you can host your images either through QlikView webserver or if serve up Accesspoint through IIS then that works also.

Copy your images to C:\Program Files\QlikView\Web\ on the server (or the corresponding path where you installed qlikview server)

This is the folder that contains your Accesspoint files.

Now you should be able to browse to http://<your servername>/qlikview/<your image>.png

Proceed to use that url for your marker expression.

Alexander_Thor
Employee
Employee
Author

Hey Sokkorn,

No no I just need to read my e-mails better next time

You are on the right track in your first post and that expression should work out of the box.

If you look at the example I attached you will see three different colored markers.

So just expand on your QV expression to included more marker colors.

You could test it by creating a straight table with latitude and longitude as dimension and then plug in your expression and set the display representation to image. If you straight table looks fine then so will the Google Maps extension.

Julie_Main
Employee
Employee

Right, i think I'm being a bit of an ejit .. I've put my image file into the following location:

C:\Program Files\QlikView\Web

and then in the definition.xml I have put in the following:

<ExtensionObject Label="GoogleMaps - Marker" Description="GoogleMaps Extension with standard markers" PageHeight="20000">

  <Dimension Label="Latitude" Initial="" DropTarget="Latitude"/>

  <Dimension Label="Longitude" Initial="" DropTarget="Longitude"/>

  <Measurement Label="Measurement" Initial="Sum(lat)"/>

  <Measurement Label="Custom Marker URL" Initial="='http://localhost/qlikview/icon1.png'" Expression="='http://localhost/qlikview/icon1.png'"/>

</ExtensionObject>

And yet it still doesn't show my cutom marker .. It's just a standard demo laptop, so uses localhost as the server name .. anything else I should have done?

I also tried entering this against the custom marker URL:

http://localhost/qlikview/icon1.png

cycle hire.JPG

bruno_martins_l
Partner - Creator
Partner - Creator

Thanks a lot, but I have tried to put the extension in my server and with the exrepssion :

if(sum({<TME_LIBC={'CONSUMPTION'}>}MES_VAL1)>0, 'http://maps.google.com/mapfiles/ms/icons/blue-dot.png','http://maps.google.com/mapfiles/ms/icons/red...')  

But the map stay empty.

Portail Mesure - Windows Internet Explorer provided by KEYRUS.jpg

Julie_Main
Employee
Employee

Very pleased with my example and a huge thank you to Alexander!!London Cycle Scheme.JPG

Sokkorn
Master
Master

Dear Alexander,

Of cause, your second attached file work well in your PC with three different marker. But for me it doesn't work. OMG, I spend nearly 4 hours to read your message in bold text below.

Alexander Karlsson wrote:

Hey Sokkorn,

No no I just need to read my e-mails better next time

You are on the right track in your first post and that expression should work out of the box.

If you look at the example I attached you will see three different colored markers.

So just expand on your QV expression to included more marker colors.

You could test it by creating a straight table with latitude and longitude as dimension and then plug in your expression and set the display representation to image. If you straight table looks fine then so will the Google Maps extension.

So why it not work in my PC? Because I use the original extension and at that time you have edit your extension and share me only .qvw. Finally I try to amend your extension (script.js and Definition.xml) and then it get my job done .

A big thanks to you...

Cheer!!!

Sokkorn

Alexander_Thor
Employee
Employee
Author

Hi Sokkorn,

Don't really know what you are talking about. Let's just be crystal clear, you do not need to edit any code.

Right click your map, hit properties, in the custom marker url box hit the fx sign and write your normal qlikview expression there.

If you are having problem with the match function there is good documentation in the qlikview help file that should get you started or you could just paste the following expression in there.

If(Match([Speed Limit],40,50,60),

          'http://maps.google.com/mapfiles/ms/icons/blue-dot.png',

          If(Match([Speed Limit],70,80,90),

          'http://maps.google.com/mapfiles/ms/icons/green-dot.png',

          'http://maps.google.com/mapfiles/ms/icons/red-dot.png'))

Sokkorn
Master
Master

Dear Alexander,

It sound you just uploaded a new extension. Below attached file was download since 25-Mar-2013 7:43 AM. And look into this, we found some different line code.

Anyhow, I would like to say many thanks for your input on my queries .

Cheer!!!

Sokkorn

Julie_Main
Employee
Employee

Is there a limit on the markers?  I remember that there was with the original one .. I'm getting a Stack Overflow error (not sure if this is to do with number of markers?)StackOverflow.JPG, in the js, although I have increased this in the xml file to 200,000.  ( I think my total markers are 24,000 or so).  I'm already trying to tie this into another application ;0)  I'll also give the clustering extension object a go as well, as this might work better although it doesn't have the customisable icons ;0)  - another quick job Alexander?!!

Alexander_Thor
Employee
Employee
Author

See my answer in the cluster thread. All three extensions share the same code base so it might just be a data problem

Kind Regards

Alexander Karlsson

28 mar 2013 kl. 12:05 skrev "jgo" <qcwebmaster@qlik.com<mailto:qcwebmaster@qlik.com>>:

QlikCommunity<http://community.qlik.com/index.jspa>

Re: Google Maps - Marker

created by jgo<http://community.qlik.com/people/jgo> in Integration and Extensions - View the full discussion<http://community.qlik.com/message/327616#327616>