Google Maps Marker Array Starter

Posted by in Code Samples, General, Web maps on .

When building a new mapping application, I frequently find myself in need of a way to collect a few locations that I can use as a starting point. I need a quick way of generating latitude and longitude, ideally for points in the area that my application will be focused on.

This week I decided to make a quick little application purely for this purpose. I hope you, too, will find this simple tool useful.

It allows you to quickly click a few points on a map, and dump their lat/lng coordinates into a javascript array. The array then appears on the page, making it easy to copy & paste into the code of a new application. I added a text-box which lets you geocode an address and add it to the array.

If you want to start with a clean slate, click “Delete Markers”. This will clear the map and empty the array.

(Open embedded page)

This code was based on Google’s ‘removing markers’ sample. I have included the code so you can make a your own copy.

Click on the map to add markers, or type address below.

This entry was posted in Code Samples, General, Web maps and tagged , , on by .

About David McCarthy

David is a web developer, and a map designer. He has been working in the web development and cartographic fields in a variety of positions, including design, development and management. He has excellent interpersonal and team leadership skills proven through systems analysis, project management and customer relations. David focuses on the front-end aspects of web development. Responsive design and mapping applications are at the top of the list. He enjoys exploring new technologies, and building upon his mapping, web design and programming skills.

Leave a Reply

Your email address will not be published. Required fields are marked *