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: 
Anonymous
Not applicable

Integrating Maps into my Qlikview Project

Hi Everyone,

I would like some assistance in adding google maps into my Qlikview project.

I have used the following example to no success: https://community.qlik.com/docs/DOC-3136#start=75

I have also left a comment on the same but no one has replied.

Will really appreciate some insight.

Regards

George

4 Replies
vikasmahajan

go through Google Map Static (For INDIA)

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
amit_saini
Master III
Master III

Hi,

See the attachment.

Thanks,

AS

Anonymous
Not applicable
Author

Thanks Vikas....not from India  but hope the group moderator will add me

Anonymous
Not applicable
Author

Thanks Amit,

the information is helpful, though i do not have already created data with longitudes and latitudes.

So basically am using a list of Cities and Countries that have no latitude/longitudes, Therefore i need to use these cities to generate the codes.

I have over 500,000  records with a column for City and Country. To generate the location codes it takes forever and finally it does not work. This is when i perform a "Reload"

This is the Piece of code i have. It only loads coordinates for  514000 - 513000=1000 records

ProviderTable:

LOAD

     [Claimed Amount] AS ClaimAmount,

     [Claim Provider Name] AS ClaimProviderName,

     [Claims Provider City] AS ClaimsProviderCity,

     [Claims Provider Region] AS ClaimsProviderRegion,

     [Claims Provider Country] AS ClaimsProviderCountry,

     %ClaimIDKey as ClaimKey

Resident CLAIMS_FACT;

let noRows = NoOfRows('ProviderTable')-513000;  //ONLY 1000 records instead of 514000, it freezes when i do not restrict

for i=0 to $(noRows)

    let a = peek('ClaimProviderName',$(i),'ProviderTable');

    let b = peek('ClaimsProviderCity',$(i),'ProviderTable');

    let c = peek('ClaimAmount',$(i),'ProviderTable');

    let d = peek('ClaimsProviderRegion',$(i),'ProviderTable');

    let e = peek('ClaimsProviderCountry',$(i),'ProviderTable');

    let f = peek('ClaimKey',$(i),'ProviderTable');

      

    GeocodeResponse:

    LOAD

    status,

    '$(a)' as ProviderName,

    '$(b)' as ProviderCity,

    '$(c)' as ProviderAmount,

    '$(d)' as ProviderRegion,

    '$(e)' as ProviderCountry,

    '$(f)' as [%ClaimIDKey],

    ([result/geometry/location/lat]) as latitude,

    ([result/geometry/location/lng]) as longitude

    FROM [http://maps.googleapis.com/maps/api/geocode/xml?address=$(b)&sensor=false] (XmlSimple, Table is [GeocodeResponse]);

next i;

// Google Maps Key

gmap_key = '';

max_zoom_level = 14;

def_zoom_level = 7;

def_map_size = 400;

// Variables required for calculating map

var_pi180        = '=pi()/180';

var_lat_offset    = '0';

var_mc2            = '=256*pow(2,$(var_zoom))';

var_mc1            = '=256*pow(2,($(var_zoom)-1))';

var_mid_lat        = '=median(latitude)';

var_mid_long    = '=median(longitude)';

var_zoom        = '=if(max(aggr(if(max(round(256*pow(2,(_zoom_level-1)))+(Longitude*((256*pow(2,_zoom_level))/360)))-min(round(256*pow(2,(_zoom_level-1)))+(Longitude*((256*pow(2,_zoom_level))/360)))<def_map_size AND max((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))-min((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))<def_map_size,_zoom_level,null()),_zoom_level))>def_zoom_level,max(aggr(if(max(round(256*pow(2,(_zoom_level-1)))+(longitude*((256*pow(2,_zoom_level))/360)))-min(round(256*pow(2,(_zoom_level-1)))+(longitude*((256*pow(2,_zoom_level))/360)))<def_map_size AND max((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))-min((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin((latitude)*pi()/180)))/(1-(sin((latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))<def_map_size,_zoom_level,null()),_zoom_level)),def_zoom_level)';

var_maptype        = '=if(isnull(only(maptype)),fieldvalue('&chr(39)&'maptype'&chr(39)&',4),maptype)';

// Calculate best zoom level

set HidePrefix    = '_';

_zoom_level:

LOAD RecNo() as _zoom_level AutoGenerate(max_zoom_level);

maptype:

LOAD * INLINE [

    Maptype

    roadmap

    mobile

    satellite

    terrain

    hybrid

];

Thanks

George