farhanwazir / laravelgooglemaps

Laravel Google Maps Package
MIT License
152 stars 112 forks source link

marker['onclick'] isn't working #48

Closed Ramiiyan closed 4 years ago

Ramiiyan commented 4 years ago

Hi, How to add a function on marker['onclick'] in my PHP? something like this.. $marker['onclick'] = function () { redirect('google.com'); };

Ramiiyan commented 4 years ago

I got my answer. We have to use javaScript as String, not Laravel PHP Functions. So, it will like this. $marker['onclick'] = 'window.location.href = "https://www.google.com";'