Coder Social home page Coder Social logo

egeloen / ivorygooglemapbundle Goto Github PK

View Code? Open in Web Editor NEW
217.0 20.0 154.0 1.91 MB

Google Map API v3 integration for your Symfony2 project.

Home Page: https://github.com/egeloen/ivory-google-map

License: MIT License

PHP 97.35% HTML 0.14% Shell 2.51%

ivorygooglemapbundle's Introduction

README

Travis Build Status AppVeyor Build status Code Coverage Scrutinizer Code Quality Dependency Status

Latest Stable Version Latest Unstable Version Total Downloads License

The bundle provides an integration of the Ivory Google Map library for your Symfony2 project.

Documentation

You're currently browsing the 3.x documentation, if you're using the 2.x, read this documentation instead.

Testing

The bundle is fully unit tested by PHPUnit with a code coverage close to 100%. To execute the test suite, check the travis configuration.

Contribute

We love contributors! Ivory is an open source project. If you'd like to contribute, feel free to propose a PR! You can follow the CONTRIBUTING file which will explain you how to set up the project.

License

The Ivory Google Map Bundle is under the MIT license. For the full copyright and license information, please read the LICENSE file that was distributed with this source code.

ivorygooglemapbundle's People

Contributors

arkni avatar asm89 avatar benderpremier avatar blazarecki avatar dirkbloessl avatar franmomu avatar gelolabs avatar ghua avatar mdrollette avatar padam87 avatar plesiecki avatar rdohms avatar sebastiantroc avatar speto avatar vv12131415 avatar warxcell avatar whisller avatar wodor avatar wpottier 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

ivorygooglemapbundle's Issues

get a addressComponent directly

Hello,

It would be great to be able to access a addressComponent type directly.
Ex : $result->getAddressComponents('route')

I have to map each type to a function in an entity. It would be easier this way...

Ty

Version 1.1.0 is broken

It appears version 1.1.0 is broken.

When running following command : php app/console cache:warmup this errors occurs :

Warming up the cache for the dev environment with debug true
PHP Fatal error:  Class 'Ivory\GoogleMap\Templating\Helper\Base\CoordinateHelper' not found in /private/var/www/app/cache/dev/appDevDebugProjectContainer.php on line 1580
Fatal error: Class 'Ivory\GoogleMap\Templating\Helper\Base\CoordinateHelper' not found in  /private/var/www/app/cache/dev/appDevDebugProjectContainer.php on line 1580

Currently installed versions :
GoogleMapBundle : 1.1.0
GoogleMap : 0.9.1 (installed by the bundle)

Add an overlay container.

Hello,

You should add an overlays container in order to reuse them in external js or other stuff ... and be abble to add for eg a clearoverlay function in our external js.
cirlces[] =
markers [] =
etc.

I'm in an app where I don't want ivoryGMB to render the map but only markers and overlays so I have to do define my js map var and do partial rendering (markers, circles, etc.)

Float coordinates

My app works with float coordinates, but the method Ivory\GoogleMapBundle\Model\Map::setCenter() just accepts integer values. If I use is_numeric() instead of is_int() it works fine.

How to inject ivory_google_map.map to a controller as a service

I've been making my controllers as services and wanted to use the ivory_google_map.map service. But injecting it the normal way through a setter doesn't work because ivory_google_map.map has prototype scope.

ScopeCrossingInjectionException: Scope Crossing Injection detected: The definition "acme_main.controller.signup" references the service "ivory_google_map.map" which belongs to another scope hierarchy. This service might not be available consistently. Generally, it is safer to either move the definition "acme_main.controller.signup" to scope "prototype", or declare "container" as a child scope of "prototype". If you can be sure that the other scope is always active, you can set the reference to strict=false to get rid of this error.

It seems to me like I wouldn't want the Controller to be in the prototype scope. So how should I inject this service? Am I missing something? It sounds like it's a "bad" idea to inject the whole service container if I don't need to (http://symfony.com/doc/current/cookbook/service_container/scopes.html). Ideally I'd just like to inject something like a "map factory" but that doesn't seem to exist.

maptypeid error

After update vendors:

Fatal error: Class 'Ivory\GoogleMap\MapTypeId' not found in {root}/vendor/bundles/Ivory/GoogleMapBundle/DependencyInjection/Configuration.php on line 125

change default infoWindows style

Hi!
I have a problem. In my project i must change default infoWindows style, but i can't understand, how i can do it.
Maybe someone can help me?

Error with installation in symfony 2.1 (zipball/v1.0 not found)

I tried to install the bundle in Symfony 2.1 by following the instructions.
However after using composer update I first was asked to login at GitHub to be allowed to access the private repo (is it supposed to be private?)
and after I provided that, I got

The "https://api.github.com/repos/egeloen/IvoryGoogleMapBundle/zipball/v1.0" file could not be downloaded (HTTP/1.1 404 Not Found)
Is there some misconfiguration in the repo or composer?

How to create entity database

Hi,

I tried all day long to create Marker database and other entities of the bundle without any sucess...
When I do doctrine:mapping:info, i got all the entities of the bundle, but i can't update them in the database with
doctrine:schema:update --force.

Please help!!!
Ty

JS: character reference used in URL

The external Javascript referenced by google_map_js() does not escape the ampersand (&) in the URL:

<script type="text/javascript" src="http://maps.google.com/maps/api/js?libraries=geometry&sensor=false&language=en"></script>

The ampersand should be escaped as &amp; as in:

<script type="text/javascript" src="http://maps.google.com/maps/api/js?libraries=geometry&amp;sensor=false&amp;language=en"></script>

On that same note, geometry does not need to be included if it isn't used.

Autozoom & circle radius

Hello,

Is it possible for autozoom to take into account the radius of a circle ?

I saw a bound->extend() in the map addCircle method but it only takes into account the center of the circle ...
Is there a workaround ?
I d'ont get it

Thank you in advance.

google maps validation

The current implementation doesn't validate html5:

solution:

Templating/Helper/Maphelper.php
line 285-300

replace the '&' (ampersand) in the url with '&'

Ok?

Directions $copyrights issue

Hi all,

My prod. website is offline because of this error (no push to prod today) and it was working well before.

capture decran 2013-06-04 a 16 50 53

it seems that the undefined property of $copyrights fucked up everything...

"google_map_container" does not exist

Hi.

I have my own custom bundle (Mapper\GoogleMapBundle)

and have a default controller as follows:

namespace Mapper\GoogleMapBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Ivory\GoogleMapBundle\Model\MapTypeId;
use Ivory\GoogleMapBundle\IvoryGoogleMapBundle;

class DefaultController extends Controller
{
  public function loadAction()
  {
    $map = $this->get('ivory_google_map.map');
   //....configured as per the documentation...
   return $this->render('MapperGoogleMapBundle:Default:load.html.twig', array('map' => $map));
  }
}

and I have this in my twig file:

{{ google_map_container(map) }}
{{ google_map_js(map) }} 

and I get an error as follows:

The function "google_map_container" does not exist in MapperGoogleMapBundle:Default:load.html.twig at line 1
500 Internal Server Error - Twig_Error_Syntax

I'm scratching my head...
I don't know what is going on!

I'm very new to symfony2.

Just testing out different stuff.

Please help.
Much appreciated.

Thanks
Momo Taro.

Problem &amp;

Hi,

I just find out that the generation of the javascript code was not good for me even if the gmap displays properly.
The generated script is this one:

<script type="text/javascript" src="http://maps.google.com/maps/api/js?language=en&sensor=false"></script>

which lead to this error when you click on the link

alert("The Google Maps API server rejected your request. The \x22sensor\x22 parameter specified in the request must be set to either \x22true\x22 or \x22false\x22.").

To solve this out, I modified the $url of MapHelper.php on line 287

$url .= sprintf('language=%s&sensor=false',
$map->getLanguage()
);

I think this is due to an autoescaping strategy but I did not find any other solution.

Please share your thought about it.

Cheersssssssss

Provider::buildGeocoderResponse() must be an instance of stdClass, null given

Hello,

First thanks for reading. In my localhost all is working fine but in my production server i get this error:

Catchable Fatal Error: Argument 1 passed to Ivory\GoogleMapBundle\Model\Services\Geocoding\Provider::buildGeocoderResponse() must be an instance of stdClass, null given, called in /usr/home/ongcarmel.net/web/carmelitas/vendor/bundles/Ivory/GoogleMapBundle/Model/Services/Geocoding/Provider.php on line 137 and defined in /usr/home/ongcarmel.net/web/carmelitas/vendor/bundles/Ivory/GoogleMapBundle/Model/Services/Geocoding/Provider.php line 243

It's probably caused by a misconfiguration, but I can not find the problem.

How to display the map ?

How to display the minimum of map ?
I try this code in my own bundle/controller, but nothing apears in the view:

use Ivory\GoogleMapBundle\IvoryGoogleMapBundle;
...
public function showMapAction()
{

    $map    = $this->get('ivory_google_map.map');           
    return $this->render('MMproBundle:Vehicule:showmap.html.twig', array(
        'map' => $map,          
        ));
}

The twig view:
...

{{ google_map_js(map) }}
{{ google_map_container(map) }}

...

Can you help me ?

Unclear Doc

All the entities has been pre-configured except for the ID & the association. You will say : "WHY ?!".
Simply because if you would like to just persist a part of the entites, you can.

How is that exactly done? Can you provide an example class overriding Map()?? Great Bundle BTW...

Thanks in advance... ;-)

Closing other info windows when opening one

You could consider adding an option to map (?) , to allow only one info window to be opened.

this can be done by changing the way event is created
instead of

var event_4f07735701880 = google.maps.event.addListener(marker_4f077356f28a6, "click", function(){info_window_4f077356f2a9b.open(tripsmap, marker_4f077356f28a6);});

you could create something like this

var event_4f0772ee84f28 = google.maps.event.addDomListener(marker_4f0772ee84ce0, "click", function() {
            if(openedInfoWindow !== undefined) {
                openedInfoWindow.close();
            }
            info_window_4f0772ee84e10.open(tripsmap, marker_4f0772ee84ce0);
            openedInfoWindow = info_window_4f0772ee84e10;
            }, false);

(this code is not state-of-the-art but works)

the drawback is that there must exist 'openedInfoWindow' somewhere in global javascript scope , this is why I think that this should be option of Map.

and maybe there are cleaner solutions....

Add Geocoder

First of all, thanks for this really nice bundle.

I saw recently you've added PHP geocoding stuffs, that's cool but in order to put your bundle on steroids, what about using Geocoder, the PHP 5.3 lib for geocoding ?

That way you could provide a powerful bundle not just for Google Maps (even if it's great), to no reinvent the wheel, and to provide your useful ideas on Geocoder too ;)

Cheers,
William

Not possible to use template helper

Because of private definition of templating helper it is not possible to use
ivory_google_map service in php templates
line 12 in helper.xml public="false"

MapHelper not registered for PHP template engine

Hi
I am not using twig templates and I had problem using this bundle in my project.
MapHelper service is not tagged for templating.helper and is not accessible from PHP view.
For now i created my own helper service which calls methods from \Ivory\GoogleMapBundle\Templating\Helper\MapHelper.
Is it possible to register MapHelper for PHP template engine aswell?

Rendering multiple maps on same page

Including google maps api javascript file gives such message:

"Warning: you have included the Google Maps API multiple times on this page. This may cause unexpected errors."

Maybe there should be some way to load maps api only once... maybe even in head section of page. Dont know yet what solution will not break backwards compatibility. Maybe adding second parameter to renderJavascripts method?

1.1 version and php templates

How can I use new version of bundle in php templates when helper is being removed from bundle?
Are only twig templates supported by bundle?

Symfony 2.1

Hi,

I have tried upgrade to symfony 2.1 but I get this error message:

[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
The service "ivory_google_map.place_search" has a dependency on a non-existent service "buzz".

Any idea?

Thanks

Tests

Add unit tests...

Add geocoder XML parser

The geocoder service allows to configure response format by JSON or XML. Currently, only JSON is implemented.

ErrorException on MapHelper

I just updated my vendors (composer update), and I have this error :

ErrorException: Catchable Fatal Error: Argument 2 passed to Ivory\GoogleMap\Templating\Helper\MapHelper::__construct() must be an instance of Ivory\GoogleMap\Templating\Helper\Base\BoundHelper, instance of Ivory\GoogleMap\Templating\Helper\MapTypeIdHelper given, called in /....cache/dev/stubDevDebugProjectContainer.php on line 2609 and defined in /..../vendor/egeloen/google-map/src/Ivory/GoogleMap/Templating/Helper/MapHelper.php line 134

In my composer.json :
"egeloen/google-map-bundle": "dev-master",
"willdurand/geocoder": "dev-master",

Method setOption does not exists

I've tried to set the zoom in a map and I got this error:

Call to undefined method Ivory\GoogleMapBundle\Model\Map::setOption().

I've just create the method as bellow and now it works.

public function setOption($name, $value)
{
$this->mapOptions[$name] = $value;
}

Stylesheet option "width" does not exist

After composer update this morning I found out that the bundle throws a MapException: "The stylesheet option "width" does not exist."

I am just blind? I didn't change anything. On saturday, everything worked fine...

Thanks a lot!

Set the animation property of the Marker nullable = true

Hello,

in Ressource\config\doctrine\marker.orm.xml I think you should add the property nullable = true for the animation. Otherwise when I persist a marker that inherit from this one and that I want it to have no animation sql raise an error for the animation field that cannot be null.

invalid annotation paral

When updating with composer i'm getting the following error:
The annotation "@paraL" in method Ivory\GoogleMap\Helper\MapHelper::renderMarkers() was never imported.

@paraL should be @param :)

vendor/egeloen/google-map/src/Ivory/GoogleMap/Helper/MapHelper.php:851

Is Geocoder is required for Installation?

Unless I have missed something following the installation instructions results in this error:
Fatal error: Class 'Geocoder\Geocoder' not found

If Geocoder is required for this bundle, could you add that to the installation instructions?

In other words add Geocoder to composer.json:
{
"require": {
"egeloen/google-map-bundle": "*",
"willdurand/geocoder": "dev-master"
}
}

Update of the bundle made my markers not working

Hi @egeloen ,

I just updated the bundle and only the last one marker is displaying on the google map... which is a problem.
My code is something like that:
\ouse Ivory\GoogleMap\Overlays\Animation;
puse Ivory\GoogleMap\Overlays\Animation;

$markerX = $this->get('ivory_google_map.marker');
$markerX->setPrefixJavascriptVariable('marker_');
$markerX->setPosition(47.214962,-1.55429, true);

$eventX = $this->get('ivory_google_map.event');
$eventX->setInstance($marker4->getJavascriptVariable());
$eventX->setEventName('click');
$eventX->setHandle('function(){showShopInMap("boucherie-du-bouffay")}');

I have 3 of them... any idea

get the map_53efd in javascript

Hello all,

I need to change the setCenter option if the user click on a certain element.
Do any of you know how to get the map as it has a name that change on every reload?

Thx folks!

Baptiste

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.