Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here we are!
The 2.0 version is not only on my computer but is on GitHub too. It is fully working and fixes #46, #53, #86, #87, #89 and probably #88 :) All I have still some parts to tweak but the major changes have already be applied.
What is new?
Basically, there is not many new features but this release fixes some architecture problems which does not allow to archive some simple use case such as rendering multiple maps on the same page... Additionally, some parts have been refactored in order to ease further feature additions. Anyway, there is some new features such as:
Additionally, no google map features have been dropped.
What are the changes?
Dependencies
The Symfony2 event dispatcher is now mandatory and the
widop/http-adapter
has been replaced by theegeloen/http-adapter
which follows the PSR-7 standard.Additionally, the Symfony2 dependency injection can be used natively and the library is still compatible with
willdurand/geocoder
:)Model changes
Places autocomplete
Map
Ivory\GoogleMap\Map::$autoZoom
toIvory\GoogleMap\Overlays\Overlays::$autoZoom
.Controls
Ivory\GoogleMap\Controls\Controls
) available through the map ($map->getControls()
).ControlClass::get*()
have been dropped.Ivory\GoogleMap\Controls\ScaleControl::$controlPosition
has been dropped as it is no more supported.Overlays
Ivory\GoogleMap\Overlays\Overlays
) available through the map ($map->getOverlays()
).Layers
Ivory\GoogleMap\Layers\Layers
) available through the map ($map->getLayers()
).Events
Ivory\GoogleMap\Events\DomEvent
has been introduced in order to specialize the dom event instead of using an event. Accordingly, theIvory\GoogleMap\Events\Event::$capture
property has been dropped.Base
Extends
Ivory\GoogleMap\Base\Bound::extends
toIvory\GoogleMap\Overlays\Overlays::$extends
.Setter exceptions
All POPO setter's exception have been removed. All is documented, so, it is your responsibility to pass what is documented, so, no need to check everything, everywhere making lot of code duplication and not easily readable...
Function prototypes
All
func_get_args
which allow to use multiple function prototypes have been dropped. For example, before you could do:In this example, the map auto generates a coordinate object for you but it results to a lot of code duplication in all setters and make the code really not readable... Then, now, you will need to do:
The same goes for all setter in all objects.
Renaming
Ivory\GoogleMap\Assets\AbstractJavascriptVariableAsset
has been renamed toIvory\GoogleMap\Assets\AbstractVariableAsset
and these getters/setters have been renamed accordingly.Ivory\GoogleMap\Overlays\MarkerImage
has been renamed toIvory\GoogleMap\Overlays\Icon
and all getters/setters in the library have been renamed accordingly.Ivory\GoogleMap\Events\EventManager
has been renamed toIvory\GoogleMap\Events\Events
.Ivory\GoogleMap\Layers\KMLLayer
has been renamed toIvory\GoogleMap\Layers\KmlLayer
.Ivory\GoogleMap\Services\Utils\XmlParser
has been renamed toIvory\GoogleMap\Services\XmlParser
.Helper changes
The helpers namespace has been totally rewritten... So, as you can understand, it is the main BC break. It has been rewritten for two reasons:
In order to solve these first issue, I have decided to introduce an new helper allowing to render the api by passing the multiple maps, places autocomplete which are rendered in the page. Obviously, the api rendering has been removed from the other helpers. Then, the api rendering will be aware of all the google map elements which need to be loaded and so, the first main issue is fixed :)
For the second issue, it was a little bit more complicated (and long to implement...). How to allow to hook where you want in the rendering process? The Symfony2 event dispatcher to the rescue! Basically, all parts of the rendering process are represented by an event which are triggered by the helper. Then, an event allows you to add code or other resources (depending of the helper used). Then, you can hook where you want in the process, and it is really easy to add new features :)
In order to give you the helper configured with all the core subscribers, you will need to use the helper factory which can be either a plain php one or one using the symfony2 container.
What is missing ?
UPGRADE.md
Enjoy!