Skip to content

Building a coordinate grid using js

I’m trying to take a rectangle grid and divide it into equal size square grids and generate the coordinates in JavaScript json. So far I’ve been able to plot coordinates so they fill up the first line, but I’m not sure how I can fill the whole rectangle (I.e extending down multiple lines, not just one). I ima…

How to make a draggable for touch?

I want the orange rectangle to be draggable using mouse or touch. The function for the mouse is working for me, so I tried copying it and replacing mousedown with ontouchstart, mousemove with ontouchmove and mouseup with ontouchend but it doesn’t seem to move. Any suggestions? Thanks! Answer For one, th…