3 Replies Latest reply: Sep 4, 2013 3:33 PM by Michael Rice RSS

    Can't Get Google Map To Appear

        I’m new with Qlikview, using the personal edition to learn before buying it.   I attempted to create a map scatter
      diagram following instructions from a white paper published by Qliktech.  I think I followed it correctly- the scatter
      diagram shows bubble coordinates that make sense. Boston is in the upper right and Honolulu in the lower left, etc…

       

      My problem is I can get the underlying Google map to appear I…

       

      The data file I imported has a unique customer name, a latitude and longitude.  There’s mention
      of a geokey and I’m wonder if that’s my problem but not sure what that is.

       

      Is there something obvious I may have missed or a switch I ddn’t throw?  Better yet, an example I
      can reverse engineer?

       

      Thanks,

       

      Mike

        • Re: Can't Get Google Map To Appear
          vikas mahajan

          Hii

          Please refer my link

          http://community.qlik.com/docs/DOC-4594

           

          I have attached demo for map.

           

          Hope this resolve your issue.

           

          Good Luck

           

          Vikas

          • Re: Can't Get Google Map To Appear
            Nicolas Gioux

            Hi Mike,

             

            You haven't a good URL for the google image. Instead of

            ='http://maps.google.com/staticmap?center='&Replace(var_mid_lat,',','.')&','&Replace(var_mid_long,',','.')&'&zoom=$(var_zoom)'&'&maptype='&var_maptype&'&size='&def_map_size&'x'&def_map_size&'&key='&gmap_key

            &'.jpg'

            you need to put this expression :

            ='http://maps.googleapis.com/maps/api/staticmap?center='

            &

            num(var_mid_lat, '##############', '.', ',' )

            &

            ','

            &

            num(var_mid_long, '##############', '.', ',' )

            &

            '&zoom=$(var_zoom)'

            &

            '&maptype='&var_maptype

            &

            '&size='&map_size_x&'x'&map_size_y

            &

            '&sensor=false'

             

            For more information about the URL take a look at this documentation : Static Maps API Developer Guide - Google Maps Image APIs — Google Developers

            I attach an example application.

             

            Hope it helps.

            Regards,

             

            Nicolas

              • Re: Can't Get Google Map To Appear

                I got a map to appear but when I attempt to zoom in, it doesn't expand (but the bubbles do).

                Could it be a part of the reload?  I have a personal copy (while I decide whether to buy it) so I can't open your example.   Here's what I have in edit script which originated from a Qliktech White Paper.

                 

                gmap_key = 'AIzaSyCVReLvtPQEWY_jlhbVWMarEBrTSuUNrLI';

                max_zoom_level = 14; //maximum value 17

                def_zoom_level = 1;

                def_map_size = 400;

                // Variables required for calculating map

                // No need to change these

                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)';

                // Field required for calcualting 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

                ]
                ;