Comments (43)
You will have to do the following:
use Cornford\Googlmapper\Facades\MapperFacade as Mapper;
from googlmapper.
@tedmasterweb it should be the Google maps javascript api
from googlmapper.
Okay, you need to add a width / height onto the containing item. For example:
<div style="height: 400px; width: 400px;">{!! Mapper::render() !!}</div>
from googlmapper.
Hi,
Yeah this package does support L5. However I haven't check compatability for 5.2 as of yet. Glad you like the package!
from googlmapper.
I wasn't importing the facade due to an outdated ide helper file. All sorted now and having plenty of fun with it! Well done!
from googlmapper.
I'm sorry but could you please clarify how you are importing the Facade? I've tried
use Cornford\Googlmapper\Facades\MapperFacade;
but that doesn't seem to work.
TIA
from googlmapper.
That did the trick! Thank you for the prompt reply!
And while I've got your attention ;-) Which Google Maps API should I be enabling? There are 16 different Maps APIs. I assume it would be either Google Maps JavaScript API or Google Maps Embed API.
The API included with the sample config doesn't seem to work (but it could also be my lack of patience in configuring things).
from googlmapper.
Yeah that's correct, it's for the Javascript API. The key used in the config is one I setup with Google which I believe is keyed up to a localhost domain.
from googlmapper.
Thank you both. I've got it working now and it's great, really great. Thank you!
from googlmapper.
Please update the description and add laravel 5.0.x to 5.2.x version, so that even more colleagues would ever love your work. Peace. ^_^
from googlmapper.
I have now changed the composer.json to use 5.*.
from googlmapper.
Is this package supports laravel 5.2?I am using this package but it shown a blank page to me.
from googlmapper.
Yes, this package supports Laravel 5.2. Ensure that you have added the provider, and facade to you application config, along with publishing the packages items too.
from googlmapper.
When I run this command:
php artisan vendor:publish --provider="Cornford\Googlmapper\MapperServiceProvider"
it shows me:
Nothing to publish for tag [].
from googlmapper.
I have added service provider and aliases in config/app.php too.
from googlmapper.
Is that the only thing it shows for you?
I receive:
Copied Directory [/vendor/cornford/googlmapper/src/views] To [/resources/views/cornford/googlmapper]
Publishing complete for tag []!
Try this:
composer dump-autoload -o
php artisan vendor:publish --tag="googlmapper"
from googlmapper.
Now it shows
Copied Directory [\vendor\cornford\googlmapper\src\views] To [\resources\views\cornford\googlmapper] Publishing complete for tag [googlmapper]!
But still shows me blank page.I set GOOGLE_API_KEY in config.php and other method too as you described.
from googlmapper.
What code have you got in your controller? What do you have in your view?
from googlmapper.
My controller is:
`class MapController extends Controller
{
public function map()
{
Mapper::map(40.59726025535419, 80.02503488467874, ['marker' => false]);
// Add information window for each address
$collection = \App\Address::all();
$collection->each(function($address)
{
$content = $address->users->name;
Mapper::informationWindow($address->latitude, $address->longitude, $content);
});
return view('googlmapper', compact('collection'));
}`
And in view:
`@extends('layouts.app')
@section('content')
{!! Mapper::render() !!}
@stop`
from googlmapper.
And route is:
Route::get('googlmapper', 'MapController@map');
from googlmapper.
Still it shows blank page.
from googlmapper.
Are there any errors in console?
from googlmapper.
There is error "Uncaught ReferenceError: google is not defined" in googlemapper:232
Also
"GET http://googlemaps.github.io/js-marker-clusterer/src/markerclusterer.js net::ERR_CONNECTION_REFUSED" in googlemaper:175
from googlmapper.
Can you not access that resource? http://googlemaps.github.io/js-marker-clusterer/src/markerclusterer.js?
from googlmapper.
Yes,there is problem with this.
from googlmapper.
You could save the resource markercluster.js, from https://github.com/googlemaps/js-marker-clusterer/blob/gh-pages/src/markerclusterer.js locally, then update your view mapper.balde.php to utilise this file.
from googlmapper.
I saved the js file in public/js folder.But what I have to update in mapper.blade.php?
from googlmapper.
Replace line 5 with:
<script type="text/javascript" src="{!! URL::asset('js/markerclusterer.js') !!}"></script>
from googlmapper.
This error remains there:
Uncaught ReferenceError: google is not defined(anonymous function) @ googlmapper:70
from googlmapper.
Screenshot of console:
from googlmapper.
It looks like your request to get the Google maps api is failing. This is likely causing your issue.
from googlmapper.
I tried by changing the Google Api Key but these errors remains there.
from googlmapper.
Something is blocking your connection to Google to retrieve the api js file.
from googlmapper.
Hi!
I can't get this working,
I added: "cornford/googlmapper": "2.*"
Run the: composer update
Add to app.php:
Cornford\Googlmapper\MapperServiceProvider::class,
and
'Mapper' => Cornford\Googlmapper\Facades\MapperFacade::class,
when I try tu run : php artisan vendor:publish --provider="Cornford\Googlmapper\MapperServiceProvider" --tag=googlmapper
I get this error: [Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Cornford\Googlmapper\MapperServiceProvider' not found
from googlmapper.
Hi there,
What version of Laravel are you using?
from googlmapper.
I fixit! Thanks!
from googlmapper.
How did you fixed this?
I still have this error laravel 5.4!
from googlmapper.
Error laravel 5.3
FatalErrorException in web.php line 16:
Class 'Cornford\Googlmapper\Facades\MapperFacade' not found
in web.php (routes) in line 16
I do called :
Mapper::map(
[
'zoom' => 16,
'draggable' => true,
'marker' => false,
'eventAfterload' =>
'circleListener(maps[0].shapes[0].circle_0);'
]
);
from googlmapper.
Hi there,
Can you try the following:
php artisan vendor:publish --provider="Cornford\\Googlmapper\\MapperServiceProvider" --tag=googlmapper
from googlmapper.
Bom dia.
1 -Estou com um problema na infowindow, quando adiciono a função os meus icones personalizados somem aparecendo somente o maker padrão e mesmo assim a janela de informações não abre, preciso que ela fique fixa mostrando o nome do dispositivo.
2- Preciso exibir o percurso executado por um determinado dispositivo
pode me ajudar?
Mapper::map(-22.886449, -43.118474,
[ 'marker'=>false,
'zoom' => 10,
'draggable' => true,
'center' => true,
'cluster' => false,
'informationWindow' => 'Teste da Janela', [
'open' => true,
'maxWidth'=> 300,
'markers' => [
'icon' =>'img/ida_22.png',
'title' => '166001',
'animation' => 'DROP']],
]);
$markers = array(['lat' => -22.886449,'lng' => -43.118474],
['lat' => -22.885632,'lng' => -43.118143],
['lat' => -22.883990,'lng' => -43.119513],
['lat' => -22.885734,'lng' => -43.124988]);
// dd($markers);
foreach ($markers as $marker) {
//dd($marker['lat'], $marker['lng']);
Mapper::marker($marker['lat'], $marker['lng']);
}
from googlmapper.
@MuhammadRamzan1 Have you figured out a fix to this?
For me, I was calling the map asynchronously and needed to set the async to true in the config file.
from googlmapper.
If you still are having this issue, try the following:
use Cornford\Googlmapper\Facades\MapperFacade as Mapper;
Mapper::map(
[
'zoom' => 16,
'draggable' => true,
'marker' => false,
'eventAfterload' =>
'circleListener(maps[0].shapes[0].circle_0);'
]
);
from googlmapper.
Is this still compatible with Laravel 5.6?
from googlmapper.
Related Issues (20)
- Map Drag Event (Livewire) HOT 3
- Can you get lat/lng of clicked location? HOT 1
- Map not rendering when parent element is hidden HOT 1
- Map disappers when changing livewire model HOT 6
- gpx HOT 1
- Display KML/KMZ HOT 3
- Error Google Maps JavaScript API error: InvalidKeyMapError HOT 2
- Cornford\Googlmapper\Exceptions\MapperInstanceException No map found to add a polyline to. HOT 3
- Add new icon by click on the map view
- Drawing Layer (Library) HOT 1
- Laravel 9 support: illuminate/support v9.0? HOT 3
- Add listener 'click' on polyline ?
- DrawingManager Displayed twice based on React-18 upgrade HOT 1
- Re-rendering google
- eventClick on marker get Zoom
- Recenter Map With Livewire HOT 3
- labelClass doesnt work
- Bad Method Call Exception - Method Illuminate\Foundation\Application::share does not exist.
- Laravel 10 HOT 4
- Laravel 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from googlmapper.