Skip to content

Instantly share code, notes, and snippets.

@shgidi
shgidi / 0_reuse_code.js
Created August 8, 2017 12:46
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@shgidi
shgidi / index.html
Created September 24, 2018 12:31
Basic index for a map
<html>
<head>
<title>TA Artist Map</title>
<link rel="stylesheet" type="text/css" href="style.css">
<head>
<body>
<div id="map" class="map"></div>
<script src="map.js"></script>
<script async defer
@shgidi
shgidi / map.js
Created September 24, 2018 12:32
minimal initMap
function initMap (){
const map = new google.maps.Map(document.querySelector('#map'), {
zoom: 14,
center: {
// TA
lat: 32.0705, // N-S
lng: 34.7691 // W-E
},
@shgidi
shgidi / marker_listener.js
Created September 24, 2018 14:51
marker_listener
map.data.addListener('click', event => {
let name = event.feature.getProperty('name');
let desc = event.feature.getProperty('desc');
let position = event.feature.getGeometry().get();
let content = `
<img style="float:left; width:10px; margin-top:30px">
<div style="margin-left:120px; margin-bottom:20px;">
<h2>${name}</h2>
<p>${desc}</p>