<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Default values on Google Maps in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Default-values-on-Google-Maps/m-p/209904#M588391</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having a problem with the auto calculation of the mid_lat and mid_long calculated by the Google Maps code example.&lt;/P&gt;&lt;P&gt;In my case I want to show the big picture of the map and not only one part of it (calculated by the coordinates that i have.)&lt;/P&gt;&lt;P&gt;Any idea how to create a default view of the map ? I supposed that i have to change something in the var_mid_lat and var_mid_long variables to make it work.&lt;/P&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;&lt;BR /&gt;// Variables required for calculating map&lt;BR /&gt;// No need to change these&lt;BR /&gt;var_pi180= '=pi()/180';&lt;BR /&gt;var_lat_offset= '0';&lt;BR /&gt;var_mc2= '=256*pow(2,$(var_zoom))';&lt;BR /&gt;var_mc1= '=256*pow(2,($(var_zoom)-1))';&lt;BR /&gt;var_mid_lat= '=min(latitude)+(1+var_lat_offset)*((max(latitude)-min(latitude))/2)';&lt;BR /&gt;var_mid_long= '=min(longitude)+(max(longitude)-min(longitude))/2';&lt;BR /&gt;var_zoom= '=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)) ) &amp;lt;map_size_x 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()))))&amp;lt;map_size_y,_zoom_level,1),_zoom_level))';&lt;BR /&gt;var_maptype= '=if(isnull(only(maptype)),fieldvalue( '&amp;amp;chr(39)&amp;amp;'maptype'&amp;amp;chr(39)&amp;amp;', 1 ),maptype)';&lt;BR /&gt;map_size_x= '400'; //640&lt;BR /&gt;map_size_y= '500'; //400&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Sep 2010 17:41:06 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-09-20T17:41:06Z</dc:date>
    <item>
      <title>Default values on Google Maps</title>
      <link>https://community.qlik.com/t5/QlikView/Default-values-on-Google-Maps/m-p/209904#M588391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having a problem with the auto calculation of the mid_lat and mid_long calculated by the Google Maps code example.&lt;/P&gt;&lt;P&gt;In my case I want to show the big picture of the map and not only one part of it (calculated by the coordinates that i have.)&lt;/P&gt;&lt;P&gt;Any idea how to create a default view of the map ? I supposed that i have to change something in the var_mid_lat and var_mid_long variables to make it work.&lt;/P&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;&lt;BR /&gt;// Variables required for calculating map&lt;BR /&gt;// No need to change these&lt;BR /&gt;var_pi180= '=pi()/180';&lt;BR /&gt;var_lat_offset= '0';&lt;BR /&gt;var_mc2= '=256*pow(2,$(var_zoom))';&lt;BR /&gt;var_mc1= '=256*pow(2,($(var_zoom)-1))';&lt;BR /&gt;var_mid_lat= '=min(latitude)+(1+var_lat_offset)*((max(latitude)-min(latitude))/2)';&lt;BR /&gt;var_mid_long= '=min(longitude)+(max(longitude)-min(longitude))/2';&lt;BR /&gt;var_zoom= '=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)) ) &amp;lt;map_size_x 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()))))&amp;lt;map_size_y,_zoom_level,1),_zoom_level))';&lt;BR /&gt;var_maptype= '=if(isnull(only(maptype)),fieldvalue( '&amp;amp;chr(39)&amp;amp;'maptype'&amp;amp;chr(39)&amp;amp;', 1 ),maptype)';&lt;BR /&gt;map_size_x= '400'; //640&lt;BR /&gt;map_size_y= '500'; //400&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Sep 2010 17:41:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Default-values-on-Google-Maps/m-p/209904#M588391</guid>
      <dc:creator />
      <dc:date>2010-09-20T17:41:06Z</dc:date>
    </item>
  </channel>
</rss>

