add js variable to store midpoint coordinates once calculated.