{"id":63905,"date":"2024-06-22T03:01:34","date_gmt":"2024-06-21T17:01:34","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=63905"},"modified":"2024-06-22T09:15:49","modified_gmt":"2024-06-21T23:15:49","slug":"google-chart-image-chart-geojson-issue-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/google-chart-image-chart-geojson-issue-tutorial\/","title":{"rendered":"Google Chart Image Chart Geojson Issue Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/GeoChart\/image_chart.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Google Chart Image Chart Geojson Issue Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/GeoChart\/rangegeo_fix_re_image_chart.gif\" title=\"Google Chart Image Chart Geojson Issue Tutorial\" style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Google Chart Image Chart Geojson Issue Tutorial<\/p><\/div>\n<p>Do you remember our fears, expressed at <a target=_blank title='Region Picker Popup Menu Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/region-picker-popup-menu-tutorial\/'>Region Picker Popup Menu Tutorial<\/a>, as we were discussing <font size=1>(what used to be)<\/font> the brilliant Google Chart Image Chart functionality &#8230; <\/p>\n<blockquote><p>\n &#8230; and we feel we might have &#8220;put the mockers&#8221; on ourselves, because, as you may have read, <a target=_blank title='Google Chart Geo Chart information from Google' href='https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/geochart'>Geo Chart<\/a> <a target=_blank title='Google Charts Image Chart' href='https:\/\/developers.google.com\/chart\/image\/docs\/gallery\/chart_gall'>Image Chart<\/a> is due for deprecation soon.  In fact, the regime at the moment is fewer and fewer hours up, and we&#8217;ll have to turn our attention to alternatives.  But what out there can do those regional views where the map effectively hugs the bounds of the data &#8230; brilliant, and we think hard to do with your normal Google Charts suite of software?  As well as the image element result, even though we need to try out the &#8220;ready event&#8221; normal Google Charts &#8220;print&#8221; way to achieve this.  So much more useful than involving Javascript.  And more fun to work with too, it being a conduit to HTML <a target=_blank title='HTML Canvas element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_canvas.asp'>canvas<\/a> usage.\n<\/p><\/blockquote>\n<p> &#8230; regarding it&#8217;s imminent demise <font size=1>(and don&#8217;t you just hate the word &#8220;deprecation&#8221;)<\/font>?<\/p>\n<p>Well, it happened.  Where does that leave our integrations regarding Google Chart Image Chart Map Chart we developed with <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/GeoChart\/image_chart.php\">this inhouse PHP interfacing web application<\/a>?  Well, lots is still showing, &#8220;hoping for redemption&#8221;, and the GeoJson button functionality is still intact.  <a target=_blank title='?' href='https:\/\/www.youtube.com\/watch?v=PtR4cWb4HNg'>That is<\/a>, barring &#8220;friendly fire&#8221;?!<\/p>\n<p>Yes, we&#8217;re not sure when, but maybe at the time of the recent <a title='Google Chart Image Chart Map Chart Mainstream Primer Tutorial' href='#gcicmcmpt'>Google Chart Image Chart Map Chart Mainstream Primer Tutorial<\/a> we may have introduced a bug, and today we&#8217;re here to try to remedy that situation.  That situation goes &#8230;<\/p>\n<ol>\n<li>navigate to <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/PHP\/GeoChart\/image_chart.php\">image_chart.php<\/a><\/li>\n<li>fill in a comma separated list of ISO 2 character country codes into that first textbox &#8230;<\/li>\n<li>click GeoJson button<\/li>\n<\/ol>\n<p> &#8230; and it would keep a &#8220;cloudy woooorrrrlllllddd map&#8221;, alas.  We debugged it, using Google Chrome&#8217;s web inspector, <a target=_blank title=? href='https:\/\/www.youtube.com\/watch?v=e9_7GcQeiqw&#038;t=2m37s'>again<\/a>.  The error message, and here the lesson is to believe the &#8220;red squiggle underlining parts&#8221; &#8230;<\/p>\n<p><code><br \/>\nfor (xij=0; xij&lt;xars.length; xij++) { areacon='';  if (maybenogood(xars[xij].outerHTML,'FR,DE,BR,CN,US,IN,ID,AU,NZ,EG,ZA',aars[Math.max(0,eval(-3 + xij))]<span title='Thanks to https:\/\/stackoverflow.com\/questions\/28152175\/a-wavy-underline-in-css' style='background: url(data:image\/gif;base64,R0lGODdhBAADAPEAANv\/\/\/8AAP\/\/\/wAAACwAAAAABAADAEACBZQjmIAFADs=) bottom repeat-x;'>.outerHTML).indexOf(<\/span> ... <i>blahde blah<\/i> ...<br \/>\n<\/code><\/p>\n<p> &#8230; in the context of the presented error &#8230;<\/p>\n<blockquote><p>\nTypeError: Cannot read properties of undefined (reading &#8216;outerHTML&#8217;)\n<\/p><\/blockquote>\n<p> &#8230; prompted us to come up with the <font color=blue>amended<\/font> codeline &#8230;<\/p>\n<p><code><br \/>\nfor (xij=0; xij&lt;xars.length; xij++) { areacon=''; <font color=blue>if (aars.length > eval(-3 + xij)) {<\/font>  if (maybenogood(xars[xij].outerHTML,'FR,DE,BR,CN,US,IN,ID,AU,NZ,EG,ZA',aars[Math.max(0,eval(-3 + xij))].outerHTML).indexOf( ... <i>blahde blah<\/i> ... <font color=blue>}<\/font> ...<br \/>\n<\/code><\/p>\n<p> &#8230; made things right again in <a target=_blank title='Interim code' href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/GeoChart\/rangegeo.php-----GETME'>the changed<\/a> <a target=_blank title='Interim code' href='http:\/\/www.rjmprogramming.com.au\/PHP\/GeoChart\/rangegeo.php-----GETME'>rangegeo.php<\/a> PHP helping code for <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/GeoChart\/image_chart.php\">web application GeoJson button logic<\/a>.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/google-chart-image-chart-geojson-issue-tutorial\/'>Google Chart Image Chart Geojson Issue Tutorial<\/a> ...<\/p-->\n<hr>\n<p id='gcicmcmpt'>Previous relevant <a target=_blank title='Google Chart Image Chart Map Chart Mainstream Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/google-chart-image-chart-map-chart-mainstream-primer-tutorial\/'>Google Chart Image Chart Map Chart Mainstream Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Map\/map.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Google Chart Image Chart Map Chart Mainstream Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Map\/helps_itself.gif\" title=\"Google Chart Image Chart Map Chart Mainstream Primer Tutorial\" style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Google Chart Image Chart Map Chart Mainstream Primer Tutorial<\/p><\/div>\n<p>Ever since we discovered the existence of <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/index' title='Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.'>Google Chart<\/a> <a target=_blank title='Google Charts Image Chart' href='https:\/\/developers.google.com\/chart\/image\/docs\/gallery\/chart_gall'>Image Chart<\/a> Map Charts, the first foray ending with the recent <a title='Google Chart Image Chart Map Chart GeoJson Onclick Tutorial' href='#gcicmcgjot'>Google Chart Image Chart Map Chart GeoJson Onclick Tutorial<\/a>, we&#8217;ve been keen to hive off functionality &#8230;<\/p>\n<ul>\n<li>from the overused <a title=\"Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.\" href=\"https:\/\/developers.google.com\/chart\/interactive\/docs\/index\" target=\"_blank\">Google Chart<\/a> <a title=\"Google Chart Map Chart information from Google\" href=\"https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/map\" target=\"_blank\">Map Chart<\/a> (no Image Chart) &#8230;<\/li>\n<li>to both &#8230;\n<ol>\n<li><a title=\"Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.\" href=\"https:\/\/developers.google.com\/chart\/interactive\/docs\/index\" target=\"_blank\">Google Chart<\/a> <a target=_blank title='Google Chart Geo Chart information from Google' href='https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/geochart'>Geo Chart<\/a> and <\/li>\n<li><a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/index' title='Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.'>Google Chart<\/a> <a target=_blank title='Google Charts Image Chart' href='https:\/\/developers.google.com\/chart\/image\/docs\/gallery\/chart_gall'>Image Chart<\/a> Map Chart<\/li>\n<\/ol>\n<\/ul>\n<p> &#8230; given what we&#8217;ve learnt regarding <i>each of the above<\/i>&#8216;s talents, the new member of the interest group bringing regional maps into the picture better for us.<\/p>\n<p>Over many years of integrating the first as the first port of call, though, has us thinking carefully of non &#8220;bull at a gate&#8221; approaches, and today, we&#8217;re only visiting the first idea of our &#8220;three point plan&#8221; <font size=1>(so far)<\/font> &#8230;<\/p>\n<ol>\n<li>Help itself &#8230; map.php &#8230; phase 1<\/li>\n<li>Redirect to Image Chart Map Chart &#8230; map.php and\/or geo_chart.php &#8230; just after first prompt &#8230; phase 2<\/li>\n<li>Caller form method=POST map.php action interventions at onsubmit event &#8230; non map.php &#8230; phase 3<\/li>\n<\/ol>\n<p> &#8230; asking our favourite integrator to take a hit for the good of the team.  Currently map.php is stuck in the bedroom, but we fully expect they&#8217;ll be out in just a jiffy to show you a &#8220;three part&#8221; <font size=1>(so far)<\/font> PHP code intervention sequence here &#8230;<\/p>\n<p>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n. &#8230; welcome back &#8220;mappy&#8221; &#8230;\n<\/p>\n<p><code><br \/>\n  var isusdams='&lt;?php echo (isset($_POST['iso']) ? trim(str_replace('+',' ',urldecode($_POST['iso']))) : (isset($_GET['iso']) ? trim(str_replace('+',' ',urldecode($_GET['iso']))) : '')); ?&gt;';<br \/>\n  if (window.top || isusdams.trim() != '') {<br \/>\n        if (isusdams.trim() != '') {<br \/>\n          if (isusdams.indexOf(';') == -1) { isusdams+=';'; }<br \/>\n        } else if (top.document.URL.indexOf('\/dams_usa.htm') != -1) {<br \/>\n          isusdams='US;';<br \/>\n        } else if (top.document.URL.indexOf('\/australian_') != -1) {<br \/>\n          isusdams='AU;';<br \/>\n        } else if (document.URL.indexOf('iso=') != -1) {<br \/>\n          isusdams=document.URL.split('iso=')[1].split('&')[0].split('#')[0] + ';';<br \/>\n        } else if (parent.document.URL.indexOf('\/tz_places.php?iso=') != -1) {<br \/>\n          isusdams=parent.document.URL.split('\/tz_places.php?iso=')[1].split('&')[0].split('#')[0] + ';';<br \/>\n        } else if (top.document.URL.indexOf('\/tz_places.php?iso=') != -1) {<br \/>\n          isusdams=top.document.URL.split('\/tz_places.php?iso=')[1].split('&')[0].split('#')[0] + ';';<br \/>\n        }<br \/>\n  } else if (document.URL.indexOf('iso=') != -1) {<br \/>\n          isusdams=document.URL.split('iso=')[1].split('&')[0].split('#')[0] + ';';<br \/>\n  }<br \/>\n  if (isusdams != '') {  \/\/ amapidgeo<br \/>\n        if (document.getElementById('amapidgeo')) {<br \/>\n          document.getElementById('amapidgeo').click();<br \/>\n        } else {<br \/>\n          setTimeout(latergeoclick, 5000);<br \/>\n        }<br \/>\n  }<br \/>\n}<br \/>\n<br \/>\nfunction latergeoclick() {<br \/>\n        if (document.getElementById('amapidgeo')) {<br \/>\n          document.getElementById('amapidgeo').click();<br \/>\n        }<br \/>\n}<br \/>\n<\/code><\/p>\n<p> &#8230; <font color=blue>and<\/font> &#8230;<\/p>\n<p>&lt;?php echo &#8221;<br \/>\n<code><br \/>\n   function gogeo(usug) {<br \/>\n     if (documentURL.indexOf('data=') != -1) {<br \/>\n      if ((documentURL + '~').indexOf('&data=~') != -1 && ('' + pardata).replace('undefined','') != '') {<br \/>\n        documentURL=documentURL + pardata;<br \/>\n      }<br \/>\n      <font color=blue>var isusdams='\" . (isset($_POST['iso']) ? trim(str_replace('+',' ',urldecode($_POST['iso']))) : (isset($_GET['iso']) ? trim(str_replace('+',' ',urldecode($_GET['iso']))) : '')) . \"';<br \/>\n      if (window.top || isusdams.trim() != '') {<br \/>\n        if (isusdams.trim() != '') {<br \/>\n          if (isusdams.indexOf(';') == -1) { isusdams+=';'; }<br \/>\n        } else if (top.document.URL.indexOf('\/dams_usa.htm') != -1) {<br \/>\n          isusdams='US;';<br \/>\n        } else if (top.document.URL.indexOf('\/australian_') != -1) {<br \/>\n          isusdams='AU;';<br \/>\n        } else if (document.URL.indexOf('iso=') != -1) {<br \/>\n          isusdams=document.URL.split('iso=')[1].split('&')[0].split('#')[0] + ';';<br \/>\n        } else if (parent.document.URL.indexOf('\/tz_places.php?iso=') != -1) {<br \/>\n          isusdams=parent.document.URL.split('\/tz_places.php?iso=')[1].split('&')[0].split('#')[0] + ';';<br \/>\n        } else if (top.document.URL.indexOf('\/tz_places.php?iso=') != -1) {<br \/>\n          isusdams=top.document.URL.split('\/tz_places.php?iso=')[1].split('&')[0].split('#')[0] + ';';<br \/>\n        }<br \/>\n      } else if (document.URL.indexOf('iso=') != -1) {<br \/>\n          isusdams=document.URL.split('iso=')[1].split('&')[0].split('#')[0] + ';';<br \/>\n      }<br \/>\n      if (isusdams != '') {<br \/>\n      locationhref=toolong((documentURL + '%20,%20[-90.0|0.0|~%20~,999999999]').replace('\/Map', '\/GeoChart').replace('map.php', 'geo_chart.php').replace('?','?width=556&height=347&country=Places&popularity=&aregeographicals=y&').replace('title=','title=' + isusdams).replace(\/\\=\\,\/g,'=').replace(\/\\,\\~\/g,'|~').replace(\/0\\,\/g,'0|').replace(\/1\\,\/g,'1|').replace(\/2\\,\/g,'2|').replace(\/3\\,\/g,'3|').replace(\/4\\,\/g,'4|').replace(\/5\\,\/g,'5|').replace(\/6\\,\/g,'6|').replace(\/7\\,\/g,'7|').replace(\/8\\,\/g,'8|').replace(\/9\\,\/g,'9|').replace('%27|%20','%27,%20').replace('%27|','%27,').replace(\/\\~\\]\/g,'~,1]'));<br \/>\n      } else {<\/font><br \/>\n      locationhref=toolong((documentURL + '%20,%20[-90.0|0.0|~%20~,999999999]').replace('\/Map', '\/GeoChart').replace('map.php', 'geo_chart.php').replace('?','?width=556&height=347&country=Places&popularity=&aregeographicals=y&').replace(\/\\=\\,\/g,'=').replace(\/\\,\\~\/g,'|~').replace(\/0\\,\/g,'0|').replace(\/1\\,\/g,'1|').replace(\/2\\,\/g,'2|').replace(\/3\\,\/g,'3|').replace(\/4\\,\/g,'4|').replace(\/5\\,\/g,'5|').replace(\/6\\,\/g,'6|').replace(\/7\\,\/g,'7|').replace(\/8\\,\/g,'8|').replace(\/9\\,\/g,'9|').replace('%27|%20','%27,%20').replace('%27|','%27,').replace(\/\\~\\]\/g,'~,1]'));<br \/>\n      <font color=blue>}<\/font><br \/>\n      \/\/locationhref=toolong((documentURL + ',[-90.0,0.0,~%20~,999999999]').replace('\/Map', '\/GeoChart').replace('map.php', 'geo_chart.php').replace('?','?width=556&height=347&country=Places&popularity=&aregeographicals=' + agy + '&').replace(\/\\=\\,\/g,'=').replace(\/\\,\\~\/g,'|~').replace(\/0\\,\/g,'0|').replace(\/1\\,\/g,'1|').replace(\/2\\,\/g,'2|').replace(\/3\\,\/g,'3|').replace(\/4\\,\/g,'4|').replace(\/5\\,\/g,'5|').replace(\/6\\,\/g,'6|').replace(\/7\\,\/g,'7|').replace(\/8\\,\/g,'8|').replace(\/9\\,\/g,'9|').replace('%27|%20','%27,%20').replace('%27|','%27,').replace(\/\\~\\]\/g,'~,1]'));<br \/>\n      \/\/locationhref=toolong((documentURL + '').replace('\/Map', '\/GeoChart').replace('map.php', 'geo_chart.php').replace('?','?width=556&height=347&country=Places&popularity=&aregeographicals=' + agy + '&').replace(\/\\=\\,\/g,'=').replace(\/\\,\\~\/g,'|~').replace(\/0\\,\/g,'0|').replace(\/1\\,\/g,'1|').replace(\/2\\,\/g,'2|').replace(\/3\\,\/g,'3|').replace(\/4\\,\/g,'4|').replace(\/5\\,\/g,'5|').replace(\/6\\,\/g,'6|').replace(\/7\\,\/g,'7|').replace(\/8\\,\/g,'8|').replace(\/9\\,\/g,'9|').replace('%27|%20','%27,%20').replace('%27|','%27,').replace(\/\\~\\]\/g,'~,1]'));<br \/>\n     } else {<br \/>\n      locationhref=usug;<br \/>\n     }<br \/>\n     if (locationhref != '#') { location.href=locationhref; } locationhref='';<br \/>\n   }<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/p>\n<p> &#8230; and <font color=blue>within the map.php interactivity logic<\/font> &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n        echo ' var title = ourprompt(\"Enter Map Title (background image URL or image data URI ; separated (followed by ;) before title are options, <font color=blue>and suffix by &iso=XX for XX as country code of interest<\/font> and suffix by &lines=y for overlay clickable link lines and\/or suffix by &onclick=y for all onclick functionalities such as &brgplace=[1] for Bearing Distance table and perhaps &brgmode=trip for that table in trip order). Email Attachment Title suffixes are &emailto=[emailTo] &emailsubject=[EmailSubject] ... ' . $promptsuffix . '\", \"' . str_replace(\"+\",\" \",urldecode($GETtitle)). '\"); ' . \"\\n\";<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p> &#8230; in <a target=_blank title='Interim code' href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/Map\/map.php---------------------------------------GETME'>the changed<\/a> <a target=_blank title='Interim code' href='http:\/\/www.rjmprogramming.com.au\/PHP\/Map\/map.php---------------------------------------GETME'>map.php.php<\/a> PHP code for <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Map\/map.php\">our inhouse Google Chart Map Chart interfacer<\/a>, starting off with &#8220;hive offs&#8221; to the Geo Chart in this &#8220;first of three&#8221; <font size=1>(so far)<\/font> operation we&#8217;ve codenamed &#8230;<\/p>\n<p>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\n. &#8230; over to you &#8220;mappy&#8221; &#8230;\n<\/p>\n<blockquote><p>\n&#8220;first of three&#8221; <font size=1>(so far)<\/font> operation\n<\/p><\/blockquote>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/google-chart-image-chart-map-chart-mainstream-primer-tutorial\/'>Google Chart Image Chart Map Chart Mainstream Primer Tutorial<\/a>.<\/p-->\n<hr>\n<p id='gcicmcgjot'>Previous relevant <a target=_blank title='Google Chart Image Chart Map Chart GeoJson Onclick Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/google-chart-image-chart-map-chart-geojson-onclick-tutorial\/'>Google Chart Image Chart Map Chart GeoJson Onclick Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/GeoChart\/image_chart.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Google Chart Image Chart Map Chart GeoJson Onclick Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/GeoChart\/image_chart_geojson_onclick.jpg\" title=\"Google Chart Image Chart Map Chart GeoJson Onclick Tutorial\" style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Google Chart Image Chart Map Chart GeoJson Onclick Tutorial<\/p><\/div>\n<p>Still on the &#8220;reconstituting&#8221; trajectory yesterday&#8217;s <a title='Google Chart Image Chart Map Chart GeoJson Iframe Tutorial' href='#gcicmcgjit'>Google Chart Image Chart Map Chart GeoJson Iframe Tutorial<\/a> had, continuing on with regarding our interfacing to the <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/index' title='Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.'>Google Charts<\/a> <a target=_blank title='Google Charts Image Chart' href='https:\/\/developers.google.com\/chart\/image\/docs\/gallery\/chart_gall'>Image Chart<\/a> Map Chart hosting of GeoJson functionality, today, we &#8220;reconstitute&#8221; some &#8220;onclick&#8221; event logics for those brown map infills that occur.  Why?  Well, we figure user experience wise, people often assume a deliberately colour coded situation like this means that they might glean further information by clicking on that &#8220;minority color&#8221; at the very least, especially when we are talking &#8220;maps&#8221;, here.<\/p>\n<p>If you&#8217;re happy, and you know it, feel free to honk!<\/p>\n<p>Okay then, what do we do with these new HTML div element &#8220;onclick&#8221; event logics.  Well, so far, we&#8217;re showing a list of three nearby timezones, but the main thing is to establish the &#8220;infrastructure&#8221; to get to this event logic, and often, what you do once there, is <a href='#mystoppress'>less work<\/a>.  Not always, but quite often, we find.<\/p>\n<p><code><br \/>\n  function checkdsa(ath) {<br \/>\n   return '';<br \/>\n  }<br \/>\n  <br \/>\n  function orflag(thiscc) {<br \/>\n      var ccchar='', ccsuff='';<br \/>\n      var lri='ABCDEFGHIJKLMNOPQRSTUVWXYZ';<br \/>\n      var dri=['127462','127463','127464','127465','127466','127467','127468','127469','127470','127471','127472','127473','127474','127475','127476','127477','127478','127479','127480','127481','127482','127483','127484','127485','127486','127487'];<br \/>\n      for (var iccsuff=0; iccsuff&lt;thiscc.length; iccsuff++) {<br \/>\n        ccchar=thiscc.substring(iccsuff, eval(1 + eval('' + iccsuff))).toUpperCase();<br \/>\n        ccsuff+=String.fromCodePoint(eval('' + dri[eval('' + lri.indexOf(ccchar))])); \/\/'&#' + dri[eval('' + lri.indexOf(ccchar))] + ';';<br \/>\n      }<br \/>\n      return ccsuff;<br \/>\n  }<br \/>\n  <br \/>\n  function ouralert(athis, ctyname, isothree, isotwo, inclist) {<br \/>\n   if (isotwo == 'CH') { isotwo='CN'; }<br \/>\n   if (goes == 0) { goes=1; answered=true; }<br \/>\n   if (('' + isotwo).length == 2) { jtwo=isotwo; }<br \/>\n   if (inclist.indexOf(',') != -1) {<br \/>\n   lastflag='';<br \/>\n   lasttwo='';<br \/>\n   if (isotwo.trim() != '') {<br \/>\n   lasttwo=isotwo;<br \/>\n   lastflag=' ' + orflag(isotwo);<br \/>\n   }<br \/>\n   checkdsa(athis);<br \/>\n   var cls=inclist.replace('Longitude,Latitude coordinates are ','').split(',');<br \/>\n   longlastl=ctyname + ': ' + inclist;<br \/>\n   \/\/document.getElementById('ntz').value='';<br \/>\n   if (cwo) {<br \/>\n     if (!cwo.closed) { cwo.close(); }<br \/>\n   }<br \/>\n   cwo=window.open('\/PHP\/tz_places.php?countrycode=' + encodeURIComponent(isotwo) + '&place=' + encodeURIComponent(ctyname) + '&latitude=' + encodeURIComponent(cls[1]) + '&longitude=' + encodeURIComponent(cls[0]) + '&ntztontz=y','_blank','top=100,left=100,width=1200,height=250');<br \/>\n   cwo.onload=function(){<br \/>\n      cwo.document.title='' + ctyname;<br \/>\n   };<br \/>\n   \/\/setTimeout(lookforntz, 1000);<br \/>\n   }<br \/>\n  }<br \/>\n<\/code><\/p>\n<p>Hived off what the <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/countries.html\">GeoJson World Countries web application<\/a> already did was &#8230;<\/p>\n<ul>\n<li>used to, in its HTML <i>area<\/i> elements, set up the &#8220;onclick&#8221; call to that version of <i>function ouralert<\/i> &#8230; so we transferred that across to &#8230;<\/li>\n<li>brown coloured reconstituted HTML <i>div<\/i> elements<\/li>\n<\/ul>\n<p> &#8230; and tweaked code in <a target=_blank title='Interim code' href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/GeoChart\/rangegeo.php----GETME'>the changed<\/a> <a target=_blank title='Interim code' href='http:\/\/www.rjmprogramming.com.au\/PHP\/GeoChart\/rangegeo.php----GETME'>rangegeo.php<\/a> PHP helping code for <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/GeoChart\/image_chart.php\">web application GeoJson button logic<\/a>.<\/p>\n<p id=mystoppress>\n<p><b><i>Stop Press<\/i><\/b><\/p>\n<p>Today&#8217;s work met with a previously established PHP code file, <a target=_blank title=? href='https:\/\/www.youtube.com\/watch?v=e9_7GcQeiqw&#038;t=2m37s'>again<\/a>, and so we&#8217;ve taken the opportunity, being as we tweaked above, adding new arguments, <a target=_blank title='Interim code' href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/tz_places.php-----------------------GETME'>to change<\/a> this <a target=_blank title='Interim code' href='http:\/\/www.rjmprogramming.com.au\/PHP\/tz_places.php-----------------------GETME'>tz_places.php<\/a> by adding some more country specific smarts to the resultant display for the scenario where rangegeo.php is calling it.<\/p>\n<p>It&#8217;s not full functionality, but also, today, we open the way to some <a target=_blank title='Google Translate' href='http:\/\/translate.google.com'>Google Translate<\/a> translation interfacing with  <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/GeoChart\/image_chart.php------GETME\">our tweaked<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/GeoChart\/image_chart.php------GETME\">image_chart.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/GeoChart\/image_chart.php\">PHP web application<\/a> for you to try.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/google-chart-image-chart-map-chart-geojson-onclick-tutorial\/'>Google Chart Image Chart Map Chart GeoJson Onclick Tutorial<\/a>.<\/p-->\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d61668' onclick='var dv=document.getElementById(\"d61668\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/geojson\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d61668' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d62133' onclick='var dv=document.getElementById(\"d62133\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/map\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d62133' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d63905' onclick='var dv=document.getElementById(\"d63905\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/web-inspector\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d63905' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Do you remember our fears, expressed at Region Picker Popup Menu Tutorial, as we were discussing (what used to be) the brilliant Google Chart Image Chart functionality &#8230; &#8230; and we feel we might have &#8220;put the mockers&#8221; on ourselves, &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/google-chart-image-chart-geojson-issue-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[169,305,307,1816,1929,2267,518,520,4562,2126,997,4793,1319,4794,2099],"class_list":["post-63905","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-bug","tag-debug","tag-debugging","tag-document-title","tag-error","tag-error-message","tag-google-chart","tag-google-chrome","tag-image-chart","tag-map-chart","tag-programming","tag-red-wavy-underling","tag-tutorial","tag-underlining","tag-web-inspector"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/63905"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=63905"}],"version-history":[{"count":10,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/63905\/revisions"}],"predecessor-version":[{"id":64008,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/63905\/revisions\/64008"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=63905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=63905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=63905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}