Giter VIP home page Giter VIP logo

Comments (7)

bradcornford avatar bradcornford commented on July 18, 2024

Hi,

Have you run a publish, as the templates have been made accessible for modifications?

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

from googlmapper.

bradcornford avatar bradcornford commented on July 18, 2024

I believe you will have to access the makers via the maps array:

maps[0].makers;

from googlmapper.

kristianharmer avatar kristianharmer commented on July 18, 2024

Hey, thanks for the response :) I did run that publishing command.

Here is what I have in my controller

            $courseMarkers = $region->courses()->get();

            Mapper::map($region->latitude,$region->longitude, ['zoom' => $region->map_zoom, 'center' => true, 'scrollWheelZoom' => false, 'type' => 'ROADMAP']);

            $courseMarkers->each(function($courseMarker)
            {
                if( $courseMarker->latitude != '' && $courseMarker->longitude != '' ) {
                    $content = '<a href="/golf-course/'.$courseMarker->slug.'">'.addslashes($courseMarker->name).'</a>';
                    Mapper::informationWindow($courseMarker->latitude, $courseMarker->longitude, $content);
                }
            });


        return view('region', compact('region', 'courses', 'courseFilter'));

...and this in my view

                        <div id="map">
                            {!! Mapper::render() !!}
                        </div>

Also, I have now tested every release of version 2 and still the same problem so must be my end!

I've tried stripping out content for info windows in case it was a special char issue and also limited the records fetched to just 100 and still the same issue.

Thanks for your time in responding by the way...

from googlmapper.

bradcornford avatar bradcornford commented on July 18, 2024

What you have done appears to be correct. What error are you getting? Is it from Google Maps? Or custom JS?

from googlmapper.

bradcornford avatar bradcornford commented on July 18, 2024

Actually looking at it, the library used for marker clusters is broken currently, see: googlearchive/js-marker-clusterer#37

There is currently a pull request to fix it:
googlearchive/js-marker-clusterer#39

from googlmapper.

kristianharmer avatar kristianharmer commented on July 18, 2024

Ah that would explain it! Thanks for confirming that. Will hold tight on a fix from that repo :)

Thanks for your help all the same...

from googlmapper.

bradcornford avatar bradcornford commented on July 18, 2024

For now, you could change "mapper.blade.php" line 5 to:

<script type="text/javascript" src="https://raw.githubusercontent.com/bradcornford/js-marker-clusterer/gh-pages/src/markerclusterer.js"></script>

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.