Lee Willis

screenshot-2016-10-25-16-15-10

Adding Google Maps to your Laravel application

| 0 comments

On a recent project, I needed to add some Google Maps functionality to a number of pages. The functionality I was looking for included:

  • adding KML layers
  • adding markers onto the maps with custom info windows
  • layering photo thumbnails onto the maps.

While I’ve used the Google Maps JavaScript API plenty of times before, I was looking to minimise the amount of custom code I used. The project is Laravel-based, so I had a look around for an existing package to handle some of the basic features. I ended up picking the Googlmapper package by Brad Cornford:

With the library in place, I didn’t have to worry about the basics. Instead, I spent my time on custom elements I wanted to add. I logged an issue early on with a bug that came up with my use case, and Brad was really helpful getting it resolved and into a release. Brad is actively working on the library, and a few features I was planning as custom ended up being covered by updates to the library mid-project.

Each time I moved on to another feature I found something in the library to help me. If you’ve got developers who are comfortable with Laravel and PHP, but not necessarily JavaScript, it’s a really nice library that lets you build your solution in PHP. 

Leave a Reply

Required fields are marked *.