bradcornford / Googlmapper

An easy way to integrate Google Maps with Laravel
MIT License
464 stars 142 forks source link

latitude and longitude public in location model #333

Closed csesumonpro closed 5 years ago

csesumonpro commented 5 years ago

Dear admin, Please merge it because i need latitude and longitude public for access it. Thanks

bradcornford commented 5 years ago

Hi, why do you need public access to these variables? The have getter methods.

csesumonpro commented 5 years ago

Hi, why do you need public access to these variables? The have getter methods.

When I use Mapp rander in laravel blade file it automatically loaded some javascript related to google map inside blade file But when i use vue js with laravel if whole div wrap by vue js element id app or any other. vue js don't render any internal script under app. If i normally passed latitude and longitude from laravel controller then i can easily use iframe for render difference kinds of mapp view such as normal, streetview, satelite view just passing variable lat and lang under iframe.

` <iframe width="100%" height="500" frameborder="5" scrolling="no" marginheight="0" marginwidth="0" src="https://www.google.com/maps/embed/v1/streetview?key={{env('GOOGLE_API_KEY')}}&location={{$latitude}},{{$longitude}}&heading=1&pitch=1 &fov=35"

`

bradcornford commented 5 years ago

Hi, Looking into this more, you can use the getter methods to achieve this.

$location->getLongitude();
$location->getLatitude();