dustin10 / vichgeographicalbundle Goto Github PK
View Code? Open in Web Editor NEWA Symfony2 bundle which provides geographical features for ORM and ODM entities and object oriented javascript maps rendering.
A Symfony2 bundle which provides geographical features for ORM and ODM entities and object oriented javascript maps rendering.
i use your bundle to render a google mpas with entities..
and i would like if you add the way to use a custom marker icon and a marker shadow
best regrads
I did everything to make infoWindow show up but failed. I have set $this->setShowInfoWindowsForMarkers(true); but both true and false do nothing. Does anyone has any idea what might be the fault ?
More unit tests need to be added to cover all functionality.
Hi,
Is it possible to generate dynamic map with only Latitude / Longitude from entity and no function getAddress() ?
I get Latitude and Longitude from GPS and not from an address but it seems mandatory to have a Vich\GeographicalQuery().
Thanks in advance,
This bundle is absolutely amazing!
Is there a way to plot multiple maps instead of plotting all the markers on one map. Is this already possible?
The only way I can think of is having
{% for location in locations %}
{{ vichgeo_map_for('location', location) }}
{% endfor %}
The thing is that in LocationMap, we have:
$this->setContainerId('map_canvas');
Should I override MapHelper::prepareAndRender()?
I was just wondering if there is a way to dynamically render a map for each iteration in the loop.
Many thanks for sharing this stunning bundle.
Does VichGeographicalBundle support marker clustering?
Right now the AnnotationDriver
checks if the class name contains the Proxies\
string. This not the most elegant solution as this may not be the configured namespace (it is by default). This should be refactored to use a service that checks based on the db_driver
configured as the Proxy base class is dependent on this.
Hi,
I would like to know if you would be interested by an integration of https://github.com/willdurand/BazingaGeocoderBundle on this bundle. QueryService at this moment supports only Google. Since Geocoder is the reference in php for geolocate an address, ip, etc ... i guess it would be a good solution.
At this moment, when rate limit of google is exceeded, there is no way to fallback to an other one provider.
Would you be interested by an improvement like this ? I can contribute.
Require in composer.json has unnecessary comma after php version, which prevents adding your bundle to packagist.
"require": {
"php": ">=5.3.2",
},
Should be:
"require": {
"php": ">=5.3.2"
},
I just add the bundle to my project and I have the following class :
use Vich\GeographicalBundle\Annotation as Vich;
/**
*
@Orm\Entity()
@vich\Geographical(on="update")
*/
class Contact
{
/**Some variables */
/**
/**
/**
No special configuration.
When the object is updated I have the following error :
"Unable to find GeograhicalQuery annotation. "
Im not sure if I forgot something or if it's a problem with the bundle.
Thanks a lot for your work !
The configuration needs to be refactored so that the user can specify their own services instead of classes to override default functionality.
It's a pitty to ask a dev flavour in composer.json
Leaflet renderer uses servers from CloudMade, that works only with enterprise plans since May 1st 2014 (http://cloudmade.com/support/).
I have not figured out a good way to use custom icons with annotated entities. It is simple in pre-configured maps because the user is creating the MapMarker objects himself, but when adding markers for annotated entities it is not so simple because the decision on what icon to use will probably be a runtime decision.
Is there any recommended way to disable lookup based on any sort of criteria? For example, when running unit tests I don't want the Google map lookup to fire (since it fails sometimes and I dont' want that to break testing), but there doesn't appear to be any way to make lookup conditional other than annotation in the Entity itself which can't be written to check something like SYMFONY_ENV.
Right now when I run tests, the Mock Data import is causing it to lookup as they're inserted which is causing test problems.
as i already lined out on IRC, there is some problem with loading the annotation from the class. weird thing is: the venue entity long and lat coordinates get inserted correctly, but rendering the map throws this error.
this error occures at MapHelper.php at line 162:
$annot = $this->driver->getGeographicalAnnotation($obj); if (null === $annot) { throw new \InvalidArgumentException('Unable to find Geographical annotation'); }
as I believe this is related to some reflection or proxy issue...
Hi, i have this error and in other issue was resolved, but not for me!
Stack Trace
in /home/iraqexcavations/iraq_bootstrap/vendor/vich/geographical-bundle/Vich/GeographicalBundle/EventListener/GeographicalListener.php at line 110 -+
}
if (null === $geoQuery) {
throw new \InvalidArgumentException('Unable to find GeograhicalQuery annotation.');
}
$queryMethod = $geoQuery->getMethod();
at GeographicalListener ->updateObject (object(City), object(Geographical), null)
in /home/iraqexcavations/iraq_bootstrap/vendor/vich/geographical-bundle/Vich/GeographicalBundle/EventListener/GeographicalListener.php at line 73 -+
at GeographicalListener ->prePersist (object(LifecycleEventArgs))
in /home/iraqexcavations/iraq_bootstrap/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php at line 61 -+
at ContainerAwareEventManager ->dispatchEvent ('prePersist', object(LifecycleEventArgs))
in /home/iraqexcavations/iraq_bootstrap/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php at line 808 -+
at UnitOfWork ->persistNew (object(ClassMetadata), object(City))
in /home/iraqexcavations/iraq_bootstrap/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php at line 1588 -+
at UnitOfWork ->doPersist (object(City), array('000000007ac0bf8f00000000205d1d73' => object(City)))
in /home/iraqexcavations/iraq_bootstrap/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php at line 1546 -+
at UnitOfWork ->persist (object(City))
in /home/iraqexcavations/iraq_bootstrap/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php at line 565
thanks in advance
and great job yours ๐
stefano
Hi,
without delving too much into the code, I noticed you're using the DBAL to query entities. Do you think it could work with DoctrineODM (MongoDB) as well?
Thx
Las
Whether I use jquery_google or the google renderer I get "google is not defined" or "$ is not defined". Any thoughts on why this would happen? What am I doing wrong? Thank you.
It would be nice to add support for Leaflet. What do you think? I could provide a PR.
I don't know this is a issue or not, but just can't find any answer about it, please help:
I used class table inheritance for my entity:
// ACME\CommonBundle\Entity\Location.php
namespace ACME\CommonBundle\Entity;
use Doctrine\ORM\Mapping as ORM,
Symfony\Component\Validator\Constraints as Assert,
Vich\GeographicalBundle\Annotation as Vich;
/**
* @ORM\Entity
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="discr", type="string")
* @ORM\DiscriminatorMap({
* "branch" = "\ACME\BranchBundle\Entity\Branch",
* "place" = "Place"
* })
*
* @Vich\Geographical
*
*/
class Location
{
......
/**
* @ORM\Column(type="decimal", scale=7, nullable=true)
* @var decimal
*/
protected $latitude;
/**
* @ORM\Column(type="decimal", scale=7, nullable=true)
* @var decimal
*/
protected $longitude;
......
/**
* Set latitude
*
* @param decimal $latitude
*/
public function setLatitude($latitude)
{
$this->latitude = $latitude;
}
/**
* Set longitude
*
* @param decimal $longitude
*/
public function setLongitude($longitude)
{
$this->longitude = $longitude;
}
/**
* @Vich\GeographicalQuery
*/
public function getFullAddress()
{
return sprintf(
'%s, %s %s',
$this->address,
implode(', ', $this->geography->getFullGeographyHierarchyArray()),
$this->zipCode
);
}
}
//ACME\BranchBundle\Entity\Branch.php
namespace ACME\BranchBundle\Entity;
use ACME\CommonBundle\Entity\Location,
......
/**
* ACME\BranchBundle\Entity\Branch
......
*/
class Branch extends Location
{
......
}
When I create and persist new Branch entity, the latitude and longitude all remained null, did I miss anything?
PS. I crawled around web and found than I needed some 'key' to use the Google Geocode API, but the documentation of this bundle didn't mention about it, was that what I missed?
Is it possible that entity is updated just if longitude/latitude is null or something? Because sometimes google api return no result for longitude/latitude and then i have to correct it manually.. and after update it goes to 0, 0 ...
Maybe it would be good to implement * @vich\Geographical(on="update_if_null") or soemthing ...?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.