Skip to content

Instantly share code, notes, and snippets.

View kuamanet's full-sized avatar

KDan kuamanet

View GitHub Profile
@kuamanet
kuamanet / square-grid-gmaps.js
Created January 25, 2023 10:22
Quick & Dirty way to draw a grid of squares on a google map
const mapCenterPosition = {lat: 45.438759, lng: 12.327145} // venice
const SQUARE_SIZE = 970; // mt
// quick way to lock the drawing on the first bounds_changed event
let drawn = false;
// all of the drawn rectangles
let rectangles = []
window.initMap = () => {
const map = new google.maps.Map(document.getElementById("map"), {
zoom: 14,
center: mapCenterPosition