In addition to the comments in the mapList.js file, many (but not all) of the keys in the mapfiles are not surrounded by quotes. Fixing both of these problems allowed me to load the county maps with version 48 (and 49) for the first time. You can just do a find & replace of each key in all the mapfiles. For example, replace *polygons:* with *"polygons":*.
On Wed, Jul 8, 2020 at 3:12 PM 'Daniel LaLiberte' via Google Visualization API <[email protected]> wrote: > What do you see in your browser debugger? If there is still a JSON > problem, it will likely show up there. > > If you are serving these files from your server, you have to configure it > so that the server allows cross-origin requests for the data. This was > already true for the chrisblumberg.com site, I believe. If not allowed, > you will see an error about CORS when fetching the data, maybe only in the > network tab of the debugger. > > If you can post a link to a page demonstrating how you are using GeoChart > with this setMapsSource, that would allow me to debug it. > > On Wed, Jul 8, 2020 at 2:58 PM Donal Harrigan <[email protected]> > wrote: > >> I downloaded all the files and took the comments out of the mapList.js >> and couldn't find any in the .js files in the mapfiles subfolder. I put it >> up on Drive and set that as the map source and it's still blank. Any other >> thoughts? >> >> *Donal Harrigan* >> >> >> On Wed, Jul 8, 2020 at 1:55 PM 'Daniel LaLiberte' via Google >> Visualization API <[email protected]> wrote: >> >>> mapList.js would be the first place. But any subsequently loaded data >>> file as well. >>> >>> On Wed, Jul 8, 2020 at 1:45 PM Donal Harrigan <[email protected]> >>> wrote: >>> >>>> Are you referring to the mapList.js file in the info subdirectory? I >>>> believe that's the only place I see comments. >>>> >>>> *Donal Harrigan* >>>> >>>> >>>> On Wed, Jul 8, 2020 at 1:25 PM 'Daniel LaLiberte' via Google >>>> Visualization API <[email protected]> wrote: >>>> >>>>> For the setMapsSource call, it is now essential that the data portion >>>>> of the returned data is strict JSON, which doesn't allow embedded >>>>> comments. I believe the data from http://chrisdblumberg.com/maps does >>>>> still include comments, so hopefully, Chris Blumberg can update the county >>>>> data. Thanks. >>>>> >>>>> >>>>> On Wed, Jul 8, 2020 at 1:15 PM Donal Harrigan < >>>>> [email protected]> wrote: >>>>> >>>>>> As an update, I did the following but still cannot get the custom map >>>>>> to plot. >>>>>> >>>>>> created an Index.html in my apps script project: >>>>>> <html> >>>>>> <head> >>>>>> <script src="https://www.gstatic.com/charts/loader.js"></script> >>>>>> <script> >>>>>> google.charts.load('current', {packages: ['geochart']}); >>>>>> google.charts.setOnLoadCallback(queryGID); >>>>>> >>>>>> function queryGID() { >>>>>> var queryString = encodeURIComponent('SELECT EF,EG'); >>>>>> var query = new google.visualization.Query(<MY SHEET URL> + >>>>>> queryString); >>>>>> query.send(handleQueryResponse); >>>>>> } >>>>>> function handleQueryResponse(response){ >>>>>> if (response.isError()) { >>>>>> alert('Error in query: ' + response.getMessage() + ' ' + >>>>>> response.getDetailedMessage()); >>>>>> return; >>>>>> } >>>>>> google.visualization.GeoChart.setMapsSource(<URL TO DRIVE >>>>>> STORED DOWNLOAD OF ANDREW'S MAP FILES>); >>>>>> >>>>>> var options = >>>>>> {displayMode:'regions',region:'US-FL',resolution:'provinces'}; >>>>>> var data = response.getDataTable(); >>>>>> var chart = new >>>>>> google.visualization.GeoChart(document.getElementById("regions_div")); >>>>>> chart.draw(data,options); >>>>>> google.visualization.events.addListener(chart, 'regionClick', >>>>>> function(r) { >>>>>> console.log(r.region); >>>>>> }); >>>>>> } >>>>>> </script> >>>>>> </head> >>>>>> <body> >>>>>> <div id="regions_div" style="width: 900px; height: 500px;"></div> >>>>>> </body> >>>>>> </html> >>>>>> >>>>>> created a doGet in my project: >>>>>> function doGet(){ >>>>>> return HtmlService.createHtmlOutputFromFile('Index'); >>>>>> } >>>>>> >>>>>> Published the project as a webapp. >>>>>> >>>>>> Results: If I publish without the setMapsSource line then I get a FL >>>>>> zoom map without counties, if I publish with the setMapsSource line then >>>>>> no >>>>>> map shows up at all. I also tried this for the maps db referenced earlier >>>>>> in the email (http://chrisdblumberg.com/maps) with the same results. >>>>>> >>>>>> Any guidance would be greatly appreciated! >>>>>> >>>>>> On Wednesday, July 8, 2020 at 10:06:18 AM UTC-4, Donal Harrigan wrote: >>>>>>> >>>>>>> I'd like to be able to set the map source through Google Apps >>>>>>> Script. From reading this thread it appears that the methodology is >>>>>>> through >>>>>>> the client-side API. Is there a way to accomplish this by sourcing and >>>>>>> html >>>>>>> file within Google apps script with a doGet? I set up a simple example: >>>>>>> >>>>>>> index.html >>>>>>> <html> >>>>>>> <head> >>>>>>> <script>Enter code here... >>>>>>> google.script.run.doSomething(); >>>>>>> </script> >>>>>>> </head> >>>>>>> <body> >>>>>>> </body> >>>>>>> </html> >>>>>>> >>>>>>> test.gs >>>>>>> function doGet(){ >>>>>>> return HtmlService.createHtmlOutputFromFile('Index'); >>>>>>> } >>>>>>> function doSomething(){ >>>>>>> Logger.log("What"); >>>>>>> } >>>>>>> >>>>>>> I published the project to the web and if I visit the link, then >>>>>>> doSomething executes but if I call the url with urlfetchapp only the >>>>>>> doGet >>>>>>> executes but not doSomething >>>>>>> >>>>>>> UrlFetchApp.fetch(theURL,{method:"Get", headers: {Authorization: >>>>>>> "Bearer "+ScriptApp.getOAuthToken()}, muteHttpExceptions: true}); >>>>>>> >>>>>>> If I can get that framework working, is it possible then to just >>>>>>> include the following line in the html file >>>>>>> >>>>>>> <script type='text/javascript' >>>>>>> src='https://www.google.com/jsapi'></script> >>>>>>> >>>>>>> >>>>>>> and then be able to do anything 'google.visualization' within the >>>>>>> .gs script? >>>>>>> >>>>>>> >>>>>>> On Friday, April 24, 2020 at 10:16:26 PM UTC-4, Andrew Arnold wrote: >>>>>>>> >>>>>>>> JS county map files for every state (inc. Puerto Rico) and the >>>>>>>> United States can be downloaded here: >>>>>>>> https://drive.google.com/open?id=1j7yGIG7xmGuQ0yOptkeJK8txBA9aYvMM >>>>>>>> >>>>>>>> These were generated from KML files maintained by the U.S. Census >>>>>>>> Bureau. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "Google Visualization API" group. >>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>> send an email to >>>>>> [email protected]. >>>>>> To view this discussion on the web visit >>>>>> https://groups.google.com/d/msgid/google-visualization-api/d44172a8-6e07-4f0a-8c4f-f8c2210052c1o%40googlegroups.com >>>>>> <https://groups.google.com/d/msgid/google-visualization-api/d44172a8-6e07-4f0a-8c4f-f8c2210052c1o%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>> . >>>>>> >>>>> >>>>> >>>>> -- >>>>> Daniel LaLiberte >>>>> <https://plus.google.com/100631381223468223275?prsrc=2> >>>>> [email protected] <[email protected]> Cambridge MA >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Google Visualization API" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to [email protected]. >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJMzBEu0ut9DNwXeUpXwvMtdm9XBHXbgSWSbEGaQvR9CQg%40mail.gmail.com >>>>> <https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJMzBEu0ut9DNwXeUpXwvMtdm9XBHXbgSWSbEGaQvR9CQg%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>>> . >>>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Google Visualization API" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/google-visualization-api/CADsXKFVY9UhSm7Z3CP3qsLWM04WA96Dwb_r-5%3D8CsrdmPycZig%40mail.gmail.com >>>> <https://groups.google.com/d/msgid/google-visualization-api/CADsXKFVY9UhSm7Z3CP3qsLWM04WA96Dwb_r-5%3D8CsrdmPycZig%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> >>> >>> -- >>> Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> >>> [email protected] <[email protected]> Cambridge MA >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Google Visualization API" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJMW_aVOw7HLf_%2ByY%2BEOMtCxR9jZg0R3armEm93MySO8iQ%40mail.gmail.com >>> <https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJMW_aVOw7HLf_%2ByY%2BEOMtCxR9jZg0R3armEm93MySO8iQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google Visualization API" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/google-visualization-api/CADsXKFUXmKi5Bbri%2BRQAgyyj1K5%2BdU-quVeuv3MF_%3Dg49Gunvg%40mail.gmail.com >> <https://groups.google.com/d/msgid/google-visualization-api/CADsXKFUXmKi5Bbri%2BRQAgyyj1K5%2BdU-quVeuv3MF_%3Dg49Gunvg%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > > > -- > Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> > [email protected] <[email protected]> Cambridge MA > > -- > You received this message because you are subscribed to the Google Groups > "Google Visualization API" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJObpLyw2%2BT%3D26dD%3DkQVKH4_Kx9fC-zVjU4YQR332pfgKA%40mail.gmail.com > <https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJObpLyw2%2BT%3D26dD%3DkQVKH4_Kx9fC-zVjU4YQR332pfgKA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/CAAT7qHNpVTFbYiT92MxHH9Uu21xo7h3C-Y9tQxi1DAhK%3DzHKdA%40mail.gmail.com.
