Git Product home page Git Product logo

googlmapper's People

Contributors

atefbb avatar azorpax avatar bradcornford avatar dbr0 avatar jochensengier avatar jozeflambrecht avatar kylops avatar leewillis77 avatar michellaurent avatar sdekkers avatar syahzul avatar tailonperin avatar td204 avatar vjoao avatar vool avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

googlmapper's Issues

How do I create multiple map and render it at two places in view

I need to display multiple maps in same page or atleast with a click of button change the markers. I am not able to figure out how can I send multiple map data from controller and render it in view.

Please guide. Also make you documentation more proper and give examples for all the available options as on searching I can find there had been one commit for multiple maps but there is nothing in documentation which can guide how to implement multiple maps.

Map Click method?

Hi,

I would like to let the user mark a point in the map. In my particular case, to register a place.

I did notice that we do have the dragable marker, but I would like to also let user click in the map and make the marker move to the place where the map was clicked.

Is this possible? How can I do it?

Thanks,
Joao

Facade Call

I am trying to call Mapper facade from my controller, but I am receiving the following error message:

Non-static method Cornford\Googlmapper\Mapper::map() should not be called statically, assuming $this from incompatible context

I added Mapper::render() on my view, but I am receiving lines of HTML code instead.
What am I doing wrong?

Laravel 4 install not working

I added the lines to my composer.json and app.php, but when I send the command 'php artisan config:publish cornford/googlemapper' I receive an error:

[InvalidArgumentException]
Configuration not found.
config:publish [--path[="..."]] [--force] package

It still created the folder in my vendor folder, but not my config/packages folder when I updated composer.

I received the error message: 'Class 'Cornford\Googlmapper\Facades\Mapper' not found' when trying to use it anyway.

displaying the mapper

hello,

i am using Laravel 5.2 for viewing google maps along with different markers. but i couldn't manage to use it (view the map)

i think i have understood how this api works but i couldn't manage to see the map (render the map) but i do see the values i have retrieved using the var_dump() method.

could you please show me how i use it in my view page (php with blade).

it is not working but this is how i thought it would work:
****** in my controller class ********
$mapper = \Mapper::map($workGPSLocations[0], $workGPSLocations[1]);

return view('home')->with('mapper', $mapper);

***** view ****

<ifram width="100%" height="600" frameborder="0" style="border:0"
                            src="{!! $mapper->render(0) !!}"></ifram>

and

<ifrme width="100%" height="600" frameborder="0" style="border:0">
{!! $mapper->render(0) !!}</ifrme>

and

{!! $mapper->render(0) !!}

.
.
..

Nothing is working for me. could you please give a sample code.

Thank you!!!

Accessing map variable in JavaScript

Hi,

Awesome project, very helpful. Thanks!

I'm writing to ask how I can access the "map" variable via JavaScript. I need to update the map with new coordinate (following a search via the JS API) but I'm doing something wrong. I'm wondering if you can provide a pointer on how to do this, on how to hook into your JS code.

Specifically, I'd like to trigger a new search (against a postcode, for example) and update the map to drop the pin in the new location).

I know this isn't the best place to ask but perhaps others will find it useful.

Thanks again for the great library.

PS: in a worst-case scenario I know I can always to an AJAX call and replace the map element with the response but that seems kludgy.

Please add mouse behavior support

Hi there, thanks for your good work, I love it!

Please think about adding mousewheel support to Googlmapper. I am using Googlmapper at full width in my webpages and everytime I am scrolling my page with my mousewheel and as soon as the mouse pointer is over the map scrolling stops and instead the map is zooming in or out. I am sure a lot of people experience this behavior. It is not logical.

Recent issues - markers and clustering

Hey, I've been having issues recently with this Mapper pacakage.

Firstly, clustering stopped working with my initial implementation, although it had worked fine for weeks until I ran a composer update.

Having updated (cannot remember last version but only 2 months ago) I was gettings errors so tried your examples with info windows and markers. I seem to always get the following JS error no matter what!

ReferenceError: markers_ is not defined
if (markers_.length < this.minClusterSize_) {

Any ideas?

Great package by the way, I was initally up and running in 30 minutes.

InvalidArgumentException in FileViewFinder.php line 140: View [mapper] not found.

Hi, I've just updated my Laravel 5.0 app with composer in my vagrant box and the Googlmapper plugin does not work anymore.
The error is
InvalidArgumentException in FileViewFinder.php line 140:
View [mapper] not found.

in FileViewFinder.php line 140
at FileViewFinder->findInPaths('mapper', array('/home/vagrant/Code/XXXX/resources/views/cornford/googlmapper')) in FileViewFinder.php line 90
at FileViewFinder->findNamedPathView('googlmapper::mapper') in FileViewFinder.php line 74
at FileViewFinder->find('googlmapper::mapper') in Factory.php line 145
at Factory->make('googlmapper::mapper') in Mapper.php line 27
at Mapper->render() in Facade.php line 207

Just did:

#php artisan cache:clear
# php artisan route:clear
# php artisan config:cache
# php artisan config:clear
# composer update

with no luck...
How can solve it?

Setting marker color and other marker attributes

Hi again,

Really, really loving this module, btw…

I'm trying to set the color of markers. I've reviewed the Google Docs on the subject but I can't quite see where or how to modify the color (and other attributes) of markers.

Given:
Mapper::informationWindow($lat, $lng, 'content')

It looks like I could do something like:
Mapper::informationWindow($lat, $lng, 'content', ['markers' => ['symbol' => 'circle', 'fillColor' => 'red']])

But I'm missing something. Any help would be greatly appreciated.

Thanks and if it means extending one of your classes, I'll gladly contribute whatever I produce.

Ted

no directory found

In my laravel project 5.2.39 I am not finding app/config/app.php. What should I do ? Please help me !
Thanks....

Issue on displaying the map using 'location'

Hi Bradcornford,
Thanks for the library, however I am unable to load the map when I try below code; any help to make the below code work would be really helpful.

Mapper::location('Sheffield');
echo Mapper::render();

Laravel 5.2 support

Hey Bradley,

I'm not too sure this package supports laravel 5.2 (or 5+). Just wondering if it's possible to use in L5. I really dig the functionality. Would be great to use

Cluster icon

Hi

how to set an icon to a cluster of markers ?

View [mapper] not found.

Hi mate,
What have you changed after v2.3.0 till v2.7.0 cus I have not changed any of the code and now I have
View [mapper] not found. (View: C:\xampp\htdocs\resources\views\vendor\country.blade.php)
When I try the backup before the update everything is fine but..

Is there a way to disable Scroll Wheel ?

Is there a way to disable scroll wheel? It is possible with standard JavaScript Maps API, however I am having trouble finding it here ?

Forgot to mention I am forced to edit your source but is it something you are looking to add in or is it already in somewhere ?

Error during installtion

Hi,

I found this issue in windows command line
PHP Fatal error: Call to undefined method Cornford\Googlmapper\MapperServicePro
vider::mergeConfigFrom() in E:\xampp\htdocs\pagers-api\vendor\cornford\googlmapp
er\src\Cornford\Googlmapper\MapperServiceProvider.php on line 41
{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","me
ssage":"Call to undefined method Cornford\Googlmapper\MapperServiceProvider::m
ergeConfigFrom()","file":"E:\xampp\htdocs\pagers-api\vendor\cornford\googl
mapper\src\Cornford\Googlmapper\MapperServiceProvider.php","line":41}}
E:\xampp\htdocs\pagers-api>

when I execute this command:
php artisan vendor:publish --provider="Cornford\Googlmapper\MapperServiceProvider"

thank you

auto-center map with multiple markers

How can I auto-center the map when I have multiple markers?
e.g.

Mapper::map(null, null);
        $collection = Trip::all();


        $collection->each(function($trip)
        {
            $content = $trip->name;

            Mapper::informationWindow($trip->lat, $trip->lng, $content);
        });

Based on the lat-lng values of the trips, I want the map be centered around these information windows...

Views

Hello! How i can choose dir for load my views? 👍

Directions

Hi @bradcornford your project is very nice, I was looking for something like that, but, how to use directions? is there a way to implement this? and further I'm looking for a way to update latlon on the fly using Angular or Vue Js.
Do you have any tip for that?
Thank you.

Rendering problem

Hi,

I checked the issue 18 but nothing to do nothing is rendered and no error message. I am just testing it on my web app in the user controller and show view. Can you spot the problem?

Polygon data out of the database

I am trying to make a polygon from the database.
I the DB i have a columb called polygon with (for example)

    ['longitude' => 1, 'latitude' => 6 ],['longitude' => 2, 'latitude' => 6 ]

in the controller:

    $points = DB::table('polygons_data')->select('polygon')->get();
    $map = Mapper::map(5, -2);
    $map->polygon([$points[0]->polygon]);        
    return view('test');

but when I am trying this in the output I am having something like
$map->polygon(['['longitude' => 1, 'latitude' => 6 ],['longitude' => 2, 'latitude' => 6 ]']);

So the problem is these ' ' but they are comming automaticly,
Any ideas how to make it working

Resize map to fit markers

Thanks for the great work on Googlmapper. How would I tell Mapper to set the zoom and boundaries of the map so that it shows all of the markers? I usually do this by calling something like "resize", but I can't figure out the call with Mapper. Or maybe there's a setting when you create the map in the controller?

Thanks.

Map Boundaries

Hi again,

My other issue is that I will show a lot of markers and this could cause a the connection with the server to be too slow...
What I did in android was to get the boundaries of the map that is showing to the user and only get the points that should be showed.

Is there any way to get the boundaries? Or should I use the clustered markers in instead?

Thanks,
Joao

Cornford\Googlmapper\Mapper::map() should not be called statically

I use laravel 5.1 and when need to use Googlmapper i see this an error
Non-static method Cornford\Googlmapper\Mapper::map() should not be called statically, assuming $this from incompatible context

Note:i did some of changes in my app.php file to be comptable with laravel 5.1
Instead of 'Cornford\Googlmapper\MapperServiceProvider' Cornford\Googlmapper\MapperServiceProvider::class

And the Same thing in Facade aliases Any Suggestions

Thanks for your time and thanks for this awesome API

Problem with informationWindow

Hello

I´m using yourt great library but I´ve a problem with informationWindow.
All is integrated and the map is drawed with markers and without javascript errors.
But when i try include an informationWindow, this does not appears.
If I use a simple example like:

Mapper::map(52.381128999999990000, 0.470085000000040000)->informationWindow(53.381128999999990000, -1.470085000000040000, 'Content', ['markers' => ['animation' => 'DROP']]);

and make a render in view, the marker appear, the maps renders ok but when click over marker I can´t see the informationWindow.

Do you know where could be the problem?

Thanks!

Non-static method Cornford\Googlmapper\Mapper::map() should not be called statically, assuming $this from incompatible context

I am using Laravel 5.1 and I have eddited the composer.json and updated it. Then eddited app.php with
Cornford\Googlmapper\MapperServiceProvider::class, and
'Mapper' => Cornford\Googlmapper\Facades\MapperFacade::class, .
Then runned
php artisan vendor:publish --provider="Cornford\Googlmapper\MapperServiceProvider"
and e had 'Nothing to publish for tag []'
in routes.php
Route::get('/map', 'Test@map' );
in the model Test.php
Mapper::map(53.381128999999990000, -1.470085000000040000);

And I have this error:

Non-static method Cornford\Googlmapper\Mapper::map() should not be called statically, assuming $this from incompatible context

Any suggestion will be nice. Thank you

Number of Markers when zoom out

Hello,

When zoom out on map markers seem with number. Like this:
mapimage

U can see that it is really hard to find this small number in the map. How can we change image type of this numbers?

Also i found this kind of example.
map2

can we change icons like example?

Thanks,

Hakan

Nothing to publish for tag

I tried to publish in laravel 5 but I getting this error.

c:\xampp\htdocs\laravel>php artisan vendor:publish --provider="Cornford\Googlmapper\MapperServiceProvider"
Nothing to publish for tag [].

publishable views

Hello, can you make views publishable ? For example i need add some options , but i can't...

Render is not showing map

Hi,

I just looked for your issues here and was trying to show google maps in my page.
I just add this code to my blade file:

@section('content')
<div class="container">
    <div class="row">
        <div class="mymap">
            {!! Mapper::render() !!}
        </div>
    </div>
</div>
@endsection

but nothing is showing...
Then, I looked for the source of the page and I'm getting this:

 <div class="row">
        <div class="mymap">
            <script type="text/javascript" src="//maps.googleapis.com/maps/api/js?v=3.exp&region=BR&language=pt-br&key=removed_by_me&signed_in=false&libraries=places"></script>


    <script type="text/javascript" src="//googlemaps.github.io/js-marker-clusterer/src/markerclusterer.js"></script>
        </div>

As you can see, the javascript part, that is explained in the official google maps helper, it was not included:

    <div id="map"></div>
    <script>
      var map;
      function initMap() {
        map = new google.maps.Map(document.getElementById('map'), {
          center: {lat: -34.397, lng: 150.644},
          zoom: 8
        });
      }
    </script>

Am I missing something here? The only file that I changed was the blade file. And this is laravel's 5.2 out of the box new project.

Cheers,
Joao

Add option to access map in Javascript

Is there a way to add an extra option to Googlmapper like "$enableGlobalAccess" that allows developers to access the created map through Javascript after rendering?

The only thing this would have to do is create the var map outside of the initialize() function and now use the "var" map keyword inside of the function. That way, developers can manipulate the map after rendering by using javascript.

Auto Suggest and Display Particular property

Hay there..
Without doubt, its a nice work. However, I am planning to get location autosuggest option. Is there any way to do so?

Again, if I need to collect any particular property from Mapper::location, how can I do so?
For example, when I render location I get following result -
Location {#276 ▼ #search: "Kuala Lumpur, Malaysia " #address: "Kuala Lumpur, Federal Territory of Kuala Lumpur, Malaysia" #type: "locality" #latitude: 3.139003 #longitude: 101.686855 #placeId: "ChIJ5-rvAcdJzDERfSgcL1uO2fQ" }

From there, I just wanna get latitude and longitude result. How can I get it?

Not working for Laravel 5

It looks like the package doesn't work with Laravel 5.
I think that you have to update your service provider to be compliant with the last versions of Laravel.

 [BadMethodCallException]            
  Call to undefined method [package]

view problem

hi brad,

I use {{ $map }} in my blade view but it failed to show a map, instead a bunch of code shows as text. what is a proper way to show your map in view?

thank you!

Call to undefined method MapperServiceP rovider::mergeConfigFrom() during publish

Hi,

Would like to try it out but I'm getting this error:

Laravel 4.1.2
Wamp Server 2.5
Windows 8 (64 Bit)

Error:
C:\wamp\www\ninestars>php artisan vendor:publish --provider="Cornford\Googlmapper\MapperServiceProvider"
{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Call to undefined method Cornford\Googlmapper\MapperServiceP
rovider::mergeConfigFrom()","file":"C:\wamp\www\ninestars\vendor\cornford\googlmapper\src\Cornford\Googlmapper\MapperServiceProvider.php","l
ine":41}}

Thanks.

Data passed to views is not escaped

Tried setting a marker title with an apostrophe in it, and it broke badly:

Mapper:map($lat, $lon, ["markers"=>["title"=>"John's Place", "animation"=>"DROP"], "zoom"=>14]);

I was looking at how best to solve the problem, it seems like building the options as a PHP object inside the Marker::render() method would work well, and allow you to remove a lot of if/else logic from the view. You could simply encode it as JSON and pass the whole thing directly to the JavaScript constructor.

While investigating this, I also noticed there's a function close on line 58 of marker.blade.php that's inside an @if block. I don't think it's getting inserted if the @if isn't true.

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.