Giter VIP home page Giter VIP logo

Comments (43)

bradcornford avatar bradcornford commented on July 18, 2024 1

You will have to do the following:

use Cornford\Googlmapper\Facades\MapperFacade as Mapper;

from googlmapper.

silentFred avatar silentFred commented on July 18, 2024 1

@tedmasterweb it should be the Google maps javascript api

from googlmapper.

bradcornford avatar bradcornford commented on July 18, 2024 1

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.

bradcornford avatar bradcornford commented on July 18, 2024

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.

silentFred avatar silentFred commented on July 18, 2024

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.

tedmasterweb avatar tedmasterweb commented on July 18, 2024

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.

tedmasterweb avatar tedmasterweb commented on July 18, 2024

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.

bradcornford avatar bradcornford commented on July 18, 2024

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.

tedmasterweb avatar tedmasterweb commented on July 18, 2024

Thank you both. I've got it working now and it's great, really great. Thank you!

from googlmapper.

kreativjamesz avatar kreativjamesz commented on July 18, 2024

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.

bradcornford avatar bradcornford commented on July 18, 2024

I have now changed the composer.json to use 5.*.

from googlmapper.

MuhammadRamzan1 avatar MuhammadRamzan1 commented on July 18, 2024

Is this package supports laravel 5.2?I am using this package but it shown a blank page to me.

from googlmapper.

bradcornford avatar bradcornford commented on July 18, 2024

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.

MuhammadRamzan1 avatar MuhammadRamzan1 commented on July 18, 2024

When I run this command:

php artisan vendor:publish --provider="Cornford\Googlmapper\MapperServiceProvider"

it shows me:

Nothing to publish for tag [].

from googlmapper.

MuhammadRamzan1 avatar MuhammadRamzan1 commented on July 18, 2024

I have added service provider and aliases in config/app.php too.

from googlmapper.

bradcornford avatar bradcornford commented on July 18, 2024

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.

MuhammadRamzan1 avatar MuhammadRamzan1 commented on July 18, 2024

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.

bradcornford avatar bradcornford commented on July 18, 2024

What code have you got in your controller? What do you have in your view?

from googlmapper.

MuhammadRamzan1 avatar MuhammadRamzan1 commented on July 18, 2024

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.

MuhammadRamzan1 avatar MuhammadRamzan1 commented on July 18, 2024

And route is:
Route::get('googlmapper', 'MapController@map');

from googlmapper.

MuhammadRamzan1 avatar MuhammadRamzan1 commented on July 18, 2024

Still it shows blank page.

from googlmapper.

bradcornford avatar bradcornford commented on July 18, 2024

Are there any errors in console?

from googlmapper.

MuhammadRamzan1 avatar MuhammadRamzan1 commented on July 18, 2024

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.

bradcornford avatar bradcornford commented on July 18, 2024

Can you not access that resource? http://googlemaps.github.io/js-marker-clusterer/src/markerclusterer.js?

from googlmapper.

MuhammadRamzan1 avatar MuhammadRamzan1 commented on July 18, 2024

Yes,there is problem with this.

from googlmapper.

bradcornford avatar bradcornford commented on July 18, 2024

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.

MuhammadRamzan1 avatar MuhammadRamzan1 commented on July 18, 2024

I saved the js file in public/js folder.But what I have to update in mapper.blade.php?

from googlmapper.

bradcornford avatar bradcornford commented on July 18, 2024

Replace line 5 with:

    <script type="text/javascript" src="{!!  URL::asset('js/markerclusterer.js') !!}"></script>

from googlmapper.

MuhammadRamzan1 avatar MuhammadRamzan1 commented on July 18, 2024

This error remains there:

Uncaught ReferenceError: google is not defined(anonymous function) @ googlmapper:70

from googlmapper.

MuhammadRamzan1 avatar MuhammadRamzan1 commented on July 18, 2024

Screenshot of console:

1

from googlmapper.

bradcornford avatar bradcornford commented on July 18, 2024

It looks like your request to get the Google maps api is failing. This is likely causing your issue.

from googlmapper.

MuhammadRamzan1 avatar MuhammadRamzan1 commented on July 18, 2024

I tried by changing the Google Api Key but these errors remains there.

from googlmapper.

bradcornford avatar bradcornford commented on July 18, 2024

Something is blocking your connection to Google to retrieve the api js file.

from googlmapper.

ferreralan avatar ferreralan commented on July 18, 2024

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.

bradcornford avatar bradcornford commented on July 18, 2024

Hi there,

What version of Laravel are you using?

from googlmapper.

ferreralan avatar ferreralan commented on July 18, 2024

I fixit! Thanks!

from googlmapper.

hkerssies avatar hkerssies commented on July 18, 2024

How did you fixed this?
I still have this error laravel 5.4!

from googlmapper.

playbert avatar playbert commented on July 18, 2024

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.

bradcornford avatar bradcornford commented on July 18, 2024

Hi there,

Can you try the following:

php artisan vendor:publish --provider="Cornford\\Googlmapper\\MapperServiceProvider" --tag=googlmapper

from googlmapper.

xandedj avatar xandedj commented on July 18, 2024

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.

dougblackjr avatar dougblackjr commented on July 18, 2024

@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.

bradcornford avatar bradcornford commented on July 18, 2024

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.

michaelisip avatar michaelisip commented on July 18, 2024

Is this still compatible with Laravel 5.6?

from googlmapper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.