{ "HIGHLIGHTSTROKECOLORS": [ [ "GMAP", "#002659" ] ], "ARGPLUGINS": [ [ "cityToLong", "var block = logo.blocks.blockList[blk];var conns = block.connections;var city = logo.parseArg(logo, turtle, conns[1]);if (city == cityName) { block.value = cityLongitude;} else { var apiURL = 'https://devru-latitude-longitude-find-v1.p.mashape.com/latlon.php?location=' + city; var request = new XMLHttpRequest(); request.open('GET', apiURL, false); request.setRequestHeader('X-Mashape-Authorization', gmapMashapeKey); request.send(null); var response = request.responseText; var data = JSON.parse(response); var longitude = 0; if (data['Results'].length > 0) { data = data['Results'][0]['ll']; var parts = data.split(' '); try { cityLatitude = Number(parts[0]); cityLongitude = Number(parts[1]); var longitude = cityLongitude; cityName = city; } catch (e) { logo.errorMsg(_('Coordinate data not available.'), blk); } } else { logo.errorMsg(_('Coordinate data not available.'), blk); } block.value = longitude;}" ], [ "cityToLat", "var block = logo.blocks.blockList[blk];var conns = block.connections;var city = logo.parseArg(logo, turtle, conns[1]);if (city == cityName) { block.value = cityLatitude;} else { var apiURL = 'https://devru-latitude-longitude-find-v1.p.mashape.com/latlon.php?location=' + city; var request = new XMLHttpRequest(); request.open('GET', apiURL, false); request.setRequestHeader('X-Mashape-Authorization', gmapMashapeKey); request.send(null); var response = request.responseText; var data = JSON.parse(response); var latitude = 0; if(data['Results'].length > 0) { data = data['Results'][0]['ll']; var parts = data.split(' '); try { cityLatitude = Number(parts[0]); cityLongitude = Number(parts[1]); var latitude = cityLatitude; cityName = city; } catch (e) { logo.errorMsg(_('Coordinate data not available.'), blk); } } else { logo.errorMsg(_('Coordinate data not available.'), blk); } block.value = latitude;}" ], [ "gmap", "var block = logo.blocks.blockList[blk];var conns = block.connections;var url = logo.parseArg(logo, turtle, conns[1]);var zoom_factor = logo.parseArg(logo, turtle, conns[2]);if(!url) { url = 'http://maps.googleapis.com/maps/api/staticmap?center=42.357279,-71.065740';}if(!zoom_factor) { zoom_factor = 10;}if(zoom_factor == 0) { zoom_factor = 0;}gmapURL = url + '&size=800x800&zoom=' + zoom_factor +'&sensor=false';block.value = gmapURL;" ], [ "zoom", "var block = logo.blocks.blockList[blk];var conns = block.connections;var zoomFactor = logo.parseArg(logo, turtle, conns[1]);block.value = zoomFactor;" ], [ "coord", "var block = logo.blocks.blockList[blk];var conns = block.connections;var latitude = logo.parseArg(logo, turtle, conns[1]);var longitude = logo.parseArg(logo, turtle, conns[2]);latitude = eval(latitude);longitude = eval(longitude);if(!latitude || !longitude) { latitude = 42.357279; longitude = -71.065740;}gmapURL = 'http://maps.googleapis.com/maps/api/staticmap?center=' + latitude + ',' + longitude; block.value = gmapURL;" ] ], "GLOBALS": "gmapMashapeKey = 'JidA8phgY8mshJ8MiEUeHTdwFjjtp1wq209jsncYthfRDMQNW6';cityName = '';cityLatitude = 0;cityLongitude = 0;", "PALETTEHIGHLIGHTCOLORS": [ [ "GMAP", "#00c5ff" ] ], "PALETTEPLUGINS": [ [ "GMAP", " " ] ], "BLOCKPLUGINS": [ [ "cityToLat", "var cityToLatBlk = new ProtoBlock('cityToLat');cityToLatBlk.palette = palettes.dict['GMAP'];blocks.protoBlockDict['cityToLat'] = cityToLatBlk;cityToLatBlk.staticLabels.push(_('city latitude'));cityToLatBlk.adjustWidthToLabel();cityToLatBlk.oneArgMathBlock();cityToLatBlk.dockTypes[1] = 'anyin';cityToLatBlk.defaults.push(\"Boston\");" ], [ "cityToLong", "var cityToLongBlk = new ProtoBlock('cityToLong');cityToLongBlk.palette = palettes.dict['GMAP'];blocks.protoBlockDict['cityToLong'] = cityToLongBlk;cityToLongBlk.staticLabels.push(_('city longitude'));cityToLongBlk.adjustWidthToLabel();cityToLongBlk.oneArgMathBlock();cityToLongBlk.dockTypes[1] = 'anyin';cityToLongBlk.defaults.push(\"Boston\");" ], [ "gmap", "var gmapBlk = new ProtoBlock('gmap');gmapBlk.palette = palettes.dict['GMAP'];blocks.protoBlockDict['gmap'] = gmapBlk;gmapBlk.staticLabels.push(_('Google map'),_('coordinates'),_('zoom factor'));gmapBlk.adjustWidthToLabel();gmapBlk.twoArgMathBlock();" ], [ "zoom", "var zoomBlk = new ProtoBlock('zoom');zoomBlk.palette = palettes.dict['GMAP'];blocks.protoBlockDict['zoom'] = zoomBlk;zoomBlk.staticLabels.push(_('zoom'));zoomBlk.adjustWidthToLabel();zoomBlk.oneArgMathBlock();zoomBlk.dockTypes[1] = 'anyin';zoomBlk.defaults.push(10);" ], [ "coord", "var coordBlk = new ProtoBlock('coord');coordBlk.palette = palettes.dict['GMAP'];blocks.protoBlockDict['coord'] = coordBlk;coordBlk.staticLabels.push(_('coordinates'),_('latitude'),_('longitude'));coordBlk.adjustWidthToLabel();coordBlk.twoArgMathBlock();coordBlk.dockTypes[1] = 'anyin';coordBlk.dockTypes[2] = 'anyin';coordBlk.defaults.push(42.357279,-71.065740);" ] ], "PALETTEFILLCOLORS": [ [ "GMAP", "#00abff" ] ], "PALETTESTROKECOLORS": [ [ "GMAP", "#005aaa" ] ] }