Moved geolocation code inside maps plugin