Coded something up in Couch in an interesting way? Have a snippet or shortcode to share? Post it here for the community to benefit.
14 posts Page 1 of 2
Version: 0.9 (03.10.2014)

Hello Couchies,
recently I've come across integration of Google Maps API to Couch. It was not so easy, so I've made a module for other developers as a solution.

There are many features are accessable from Admin Panel:
- Geocode without Google's "2500 requests" restriction
- Add and remove markers
- HTML Infoblocks for markers
- Intuitive map centering and map zoom
- Choose map type and controls
- Custom map styles from http://snazzymaps.com/
- Custom icons for markers

gmaps.png
gmaps.png (138 KiB) Viewed 6132 times


To install it place the files into your project folder, register "googlemaps.php" and "contacts.php" and make your map following the included instructions.

"contacts.php" is just a sample for how to integrate GM module to your templates. I tried to make it as easy as possible.

All JS is written on Vanilla JS + GM API v3. I've tested it in modern browsers only. If there are any problems and suggestions, welcome!

Thanks

Attachments

Is this still working on Couch v2? I get a JS Error.
I am also interested to know if this works still as need google maps to be controlled from the admin side so the user can edit the location of google maps if needed in the future, I tried this but when click show coordinates after adding a address, it comes up with Geocode error: REQUEST_DENIED

I am also using couchcms v2.1
I believe Google has changed the API since this trick was posted 4 yrs ago. Also Maps now require KEY from Google - I did not like the complicated procedure to obtain one so recently in a website I used an alternative - https://www.mapbox.com/maps/streets/ which is top notch.

I have checked the addon published by my fellow countryman @Musman and did not see anything super-complicated - couch tags and javascript. I'll be happy if you adapt it to Couch version 2.2 and publish here.
Hi trendoman

I have got the api key for google maps, how easy is that alternative to integrate into couchcms v2.1 and the site so the user can change the location in the future if required
Both are not complicated to integrate. I have followed closely all your recent topics and posts - pretty hysterical imho - so please don't ask me to fix it for you for free before the midnight. I fear you might do exactly that and I hate to say no to people. :?
Oh no def would not ask to fix it for free, I want to be able to do it myself. I am not bad as I was last night as have done well with it so far today and am winning, this is one of the last things to do

Is there a guide or link you know of that goes through the steps of integrating that alternative to google maps that you included in your first reply
I have looked at the coding that @Musman has done but to be honest, would not have a clue where to start to make it work on couchcms v2.1
Forget about this addon for a second - It is good to remember CouchCMS perfectly retrofits into working static design. Try with static lat-long coordinates and follow Google's tutorials to set up map in front-end. Once html+js is fixed and is actually working in front-end, make coordinates editable in backend.

As to this addon, well, it is too early for you to fix it. If you want to be able to do things on your own in future, consider helping others in this forum by solving puzzles people post quite often. Solving issues helps to learn every aspect of CouchCMS and in no time you'll be an expert like I am or other prominent members are. Otherwise, focus on frontend and hire experienced backend coders here to fix things very very quickly without issues for you.
I can integrate google maps into the front end as before integrated couchcms, I had google maps iframe coding integrated and was working or is this link better: https://developers.google.com/maps/docu ... google-map

I would love to be able to help others by solving issues that others face
14 posts Page 1 of 2