Skip to content

Commit

Permalink
[2.0] Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
GeLoLabs committed Nov 22, 2014
1 parent 9770a3f commit 7fed5e8
Show file tree
Hide file tree
Showing 631 changed files with 53,204 additions and 25,454 deletions.
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/tests export-ignore
.coveralls.yml export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
CONTRIBUTING.md export-ignore
phpunit.xml.dist export-ignore
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@ php:
- hhvm
- hhvm-nightly

before_script: composer install --prefer-source
cache:
directories:
- vendor
- $HOME/.composer/cache

install:
- composer self-update
- composer install --prefer-source

script: bin/phpunit --coverage-clover clover.xml

after_script: bin/coveralls
after_script: bin/coveralls -v

matrix:
allow_failures:
- php: hhvm
- php: hhvm-nightly

notifications:
Expand Down
70 changes: 70 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Contributing

If you're here, you would like to contribute to this repository and you're really welcome!

## Coding standard

This repository follows the [PSR-2 standard](http://www.php-fig.org/psr/psr-2/) and so, if you want to contribute,
you must follow these rules.

## Feature request

If you think a feature is missing, please report it or even better implement it :). If you report it, describe the more
precisely what you would like to see implemented and we will discuss what is the best approach for it. If you can do
some search before submitting it and link the resources to your description, you're awesome! It will allow me to more
easily understood/implement it.

## Bug report

If you think you have detected a bug or a doc issue, please report it or even better fix it :). If you report it,
please be the more precise possible. Here a little list of required informations:

* Precise description of the bug.

## Bug fix

If you're here, you are going to fix a bug and you're the best! To do it, first fork the repository, clone it and
create a new branch with the following commands:

``` bash
$ git clone git@github.com:your-name/ivory-google-map.git
$ git checkout -b bug-fix-description
```

Then, install the dependencies through [Composer](https://getcomposer.org/):

``` bash
$ composer install
```

When you're on the new branch with the dependencies, code as much as you want and when the fix is ready, don't commit
it immediately. Before, you will need to add tests and update the doc. For the tests, everything is tested with
[PHPUnit](http://phpunit.de/) and the doc is in the markdown format under the `doc` directory.

To run the tests, use the following command:

``` bash
$ bin/phpunit
```

When you have fixed the bug, tested it and documented it, you can commit and push it with the following commands:

``` bash
$ git commit -m "Bug fix description"
$ git push origin bug-fix-description
```

If you have reworked you patch, please squash all your commits in a single one with the following commands (here, we
will assume you would like to squash 3 commits in a single one):

``` bash
$ git rebase -i HEAD~3
```

If your branch conflicts with the master branch, you will need to rebase and repush it with the following commands:

``` bash
$ git remote add upstream git@github.com:egeloen/ivory-google-map.git
$ git pull --rebase upstream master
$ git push origin bug-fix-description -f
```
81 changes: 44 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,57 @@

[![Build Status](https://secure.travis-ci.org/egeloen/ivory-google-map.png?branch=master)](http://travis-ci.org/egeloen/ivory-google-map)
[![Coverage Status](https://coveralls.io/repos/egeloen/ivory-google-map/badge.png?branch=master)](https://coveralls.io/r/egeloen/ivory-google-map?branch=master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/egeloen/ivory-google-map/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/egeloen/ivory-google-map/?branch=master)
[![Dependency Status](http://www.versioneye.com/php/egeloen:google-map/badge.svg)](http://www.versioneye.com/php/egeloen:google-map)

[![Latest Stable Version](https://poser.pugx.org/egeloen/google-map/v/stable.svg)](https://packagist.org/packages/egeloen/google-map)
[![Latest Unstable Version](https://poser.pugx.org/egeloen/google-map/v/unstable.svg)](https://packagist.org/packages/egeloen/google-map)
[![Total Downloads](https://poser.pugx.org/egeloen/google-map/downloads.svg)](https://packagist.org/packages/egeloen/google-map)
[![License](https://poser.pugx.org/egeloen/google-map/license.svg)](https://packagist.org/packages/egeloen/google-map)

The Ivory Google Map project provides a Google Map integration for your PHP 5.3+ Project. It allows you to manage map,
controls, overlays, events & services through the Google Map API v3.
controls, overlays, layers, events and services through the Google Map API v3.

## Documentation

1. [Installation](http://github.com/egeloen/ivory-google-map/blob/master/doc/installation.md)
2. [Usage](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage.md)
- [Map](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/map.md)
- [Overlays](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/overlays/index.md)
- [Marker](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/overlays/marker.md)
- [Info window](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/overlays/info_window.md)
- [Info box](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/overlays/info_box.md)
- [Polyline](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/overlays/polyline.md)
- [Encoded Polyline](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/overlays/encoded_polyline.md)
- [Polygon](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/overlays/polygon.md)
- [Rectangle](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/overlays/rectangle.md)
- [Circle](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/overlays/circle.md)
- [Ground overlay](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/overlays/ground_overlay.md)
- [Marker cluster](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/overlays/marker_cluster.md)
- [Controls](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/controls/index.md)
- [Map type](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/controls/map_type.md)
- [Overview](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/controls/overview.md)
- [Pan](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/controls/pan.md)
- [Rotate](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/controls/rotate.md)
- [Scale](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/controls/scale.md)
- [Street view](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/controls/street_view.md)
- [Zoom](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/controls/zoom.md)
- [Layers](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/layers/index.md)
- [KML Layer](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/layers/kml_layer.md)
- [Events](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/events.md)
- [Places](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/places/index.md)
- [Autocomplete](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/places/autocomplete.md)
- [Services](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/services/index.md)
- [Geocoding API](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/services/geocoding/geocoder.md)
- [Directions API](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/services/directions/directions.md)
- [Distance Matrix API](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/services/distance_matrix/distance_matrix.md)
- [Business Account](http://github.com/egeloen/ivory-google-map/blob/master/doc/usage/services/business_account.md)
- [Installation](/doc/installation.md)
- [Usage](/doc/usage.md)
- [Map](/doc/map.md)
- [Overlays](/doc/overlays/index.md)
- [Marker](/doc/overlays/marker.md)
- [Info window](/doc/overlays/info_window.md)
- [Polyline](/doc/overlays/polyline.md)
- [Encoded Polyline](/doc/overlays/encoded_polyline.md)
- [Polygon](/doc/overlays/polygon.md)
- [Rectangle](/doc/overlays/rectangle.md)
- [Circle](/doc/overlays/circle.md)
- [Ground overlay](/doc/overlays/ground_overlay.md)
- [Marker cluster](/doc/overlays/marker_cluster.md)
- [Controls](/doc/controls/index.md)
- [Map type](/doc/controls/map_type.md)
- [Overview](/doc/controls/overview.md)
- [Pan](/doc/controls/pan.md)
- [Rotate](/doc/controls/rotate.md)
- [Scale](/doc/controls/scale.md)
- [Street view](/doc/controls/street_view.md)
- [Zoom](/doc/controls/zoom.md)
- [Layers](/doc/layers/index.md)
- [Kml layer](/doc/layers/kml_layer.md)
- [Events](/doc/events/index.md)
- [Event](/doc/events/event.md)
- [Dom event](/doc/events/dom_event.md)
- [Places](/doc/places/index.md)
- [Autocomplete](/doc/places/autocomplete.md)
- [Services](/doc/services/index.md)
- [Geocoding API](/doc/services/geocoding/geocoder.md)
- [Directions API](/doc/services/directions/directions.md)
- [Distance Matrix API](/doc/services/distance_matrix/distance_matrix.md)
- [Business Account](/doc/services/business_account.md)

## Testing

The library is fully unit tested by [PHPUnit](http://www.phpunit.de/) with a code coverage close to **100%**. To execute
the test suite, check the travis [configuration](https://github.com/egeloen/ivory-google-map/blob/master/.travis.yml).
The library is fully unit tested by [PHPUnit](http://www.phpunit.de/) with a code coverage close to **100%**. To
execute the test suite, check the travis [configuration](/.travis.yml).

## Contribution

Expand All @@ -53,5 +61,4 @@ We love contributors! Ivory is an open source project. If you'd like to contribu
## License

The Ivory Google Map is under the MIT license. For the full copyright and license information, please read the
[LICENSE](https://github.com/egeloen/ivory-google-map/blob/master/LICENSE) file that was distributed with this source
code.
[LICENSE](/LICENSE) file that was distributed with this source code.
77 changes: 77 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,82 @@
# UPGRADE

### 1.4 to 2.0

* All protected properties and methods have been updated to private except for entry points. This is mostly motivated
for enforcing the encapsulation and easing backward compatibility.
* The Symfony2 event dispatcher component is a mandatory dependency.
* The Wid'op HTTP adapter library has been replaced by the Ivory HTTP adapter which follows the PSR-7.
* All exceptions related to variable types verification have been dropped.
* Multiple function prototypes have been dropped.
* All controls static methods returning a list of available controls have been dropped.

Assets:

* The `Ivory\GoogleMap\Assets\AbstractJavascriptVariableAsset` has been renamed to
`Ivory\GoogleMap\Assets\AbstractVariableAsset` and the property/getter/setter has been renamed accordingly.
The `setPrefixJavascriptVariable` and `generateJavascriptVariable` methods have been dropped and the behavior is
now archives in the constructor. Finally, the constructor now takes the variable prefix as first argument instead
of the variable.
* The `Ivory\GoogleMap\Assets\AbstractOptionsAsset` constructor now takes the variable prefix as first argument
instead of the variable.

Base:

* The `Ivory\GoogleMap\Base\Bound::$extends` property has been moved to the `Ivory\GoogleMap\Overlays\Overlays`.
* The `Ivory\GoogleMap\Base\Coordinate` longitude and latitude constructor arguments are now mandatory.
* The `Ivory\GoogleMap\Base\Coordinate::$noWrap` property have been removed and is now handled automatically.
* The `Ivory\GoogleMap\Base\Point` x and y constructor arguments are now mandatory.
* The `Ivory\GoogleMap\Base\Size` width and height constructor arguments are now mandatory.

Controls:

* The `Ivory\GoogleMap\Controls\ScaleControl::$controlPoisition` property has been dropped.

Events:

* The `Ivory\GoogleMap\Events\Event::$capture` property has been moved to `Ivory\GoogleMap\Events\DomEvent`.
* The `Ivory\GoogleMap\Events\Event` instance, event name and handle constructor arguments are now mandatory.
* The `Ivory\GoogleMap\Events\DomEvent` replaces `Ivory\GoogleMap\Events\Event` for dom events.
* The `Ivory\GoogleMap\Events\EventManager` has been renamed to `Ivory\GoogleMap\Events\Events`.

Helpers:

* The helpers namespace has been totatlly rewritten and so absolutely does not work the same way. Please to a look to
the new [documentation](/doc/helpers/rendering.md) in order to discover how it works.

Layers:

* The `Ivory\GoogleMap\Layers\KMLLayer` has been renamed to `Ivory\GoogleMap\Layers\KmlLayer`.
* The `Ivory\GoogleMap\Layers\KMLLayer` url constructor argument is now mandatory.

Map:

* The `Ivory\GoogleMap\Map::$async` has been dropped.
* The `Ivory\GoogleMap\Map::$autoZoom` has been moved to `Ivory\GoogleMap\Overlays\Overlays`.
* The `Ivory\GoogleMap\Map::$*Control` has been moved to `Ivory\GoogleMap\Controls\Controls`.
* The `Ivory\GoogleMap\Map::$kmlLayer` has been moved to `Ivory\GoogleMap\Layers\Layers`.
* The html container id is now same as the variable.

Overlays:

* The `Ivory\GoogleMap\Overlays\ExtendableInterface` must implement the `renderExtend` method.
* The `Ivory\GoogleMap\Overlays\Circle` center and radius constructor arguments are now mandatory.
* The `Ivory\GoogleMap\Overlays\Circle` value constructor argument is now mandatory.
* The `Ivory\GoogleMap\Overlays\GroundOverlay` url and bound constructor arguments are now mandatory.
* The `Ivory\GoogleMap\Overlays\InfoWindow` constructors only accepts the content and the position. Futhermore, the
content constructor argument is now mandatory.
* The `Ivory\GoogleMap\Overlays\Marker` constructors only accepts the the position which is now mandatory.
* The `Ivory\GoogleMap\Overlays\MarkerImage` has been renamed to `Ivory\GoogleMap\Overlays\Icon`. Futhermore, it only
accepts the url constructor argument which is now mandatory.
* The `Ivory\GoogleMap\Overlays\MarkerShape` type and coordinates constructor arguments are now mandatory.
* The `Ivory\GoogleMap\Overlays\Polygon` coordinates constructor argument is now mandatory.
* The `Ivory\GoogleMap\Overlays\Polyline` coordinates constructor argument is now mandatory.
* The `Ivory\GoogleMap\Overlays\Rectangle` bound constructor argument is now mandatory.

Places autocomplete:

* The html container id is now same as the variable.

### 1.3 to 1.4

* The `Ivory\GoogleMap\Helper\Utils\JsonBuilder` have been extracted to a dedicated library for reusability purpose.
Expand Down
29 changes: 22 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,42 @@
],
"require": {
"php": ">=5.3.0",
"egeloen/json-builder": "~1.0.0"
"egeloen/json-builder": "~2.0@dev",
"symfony/event-dispatcher": "~2.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"widop/http-adapter": "~1.1.0",
"willdurand/geocoder": "~2.0",
"satooshi/php-coveralls": "~0.6"
"phpunit/phpunit-mock-objects": "dev-matcher-verify as 2.3.x-dev",
"egeloen/http-adapter": "~0.1",
"satooshi/php-coveralls": "~0.6",
"symfony/dependency-injection": "~2.0",
"symfony/config": "~2.0",
"willdurand/geocoder": "~2.0"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/egeloen/phpunit-mock-objects.git"
}
],
"suggest": {
"widop/http-adapter": "Allows to use services",
"willdurand/geocoder": "Allows to use geocoding service"
"egeloen/http-adapter": "Allows to use services",
"symfony/dependency-injection": "Allows to use the container helper factory",
"symfony/config": "Allows to use the container helper factory",
"willdurand/geocoder": "Allows to use the geocoding service"
},
"autoload": {
"psr-4": { "Ivory\\GoogleMap\\": "src/" }
},
"autoload-dev": {
"psr-4": { "Ivory\\Tests\\GoogleMap\\": "tests/" }
},
"config": {
"bin-dir": "bin/"
},
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
"dev-master": "2.0-dev"
}
}
}
19 changes: 19 additions & 0 deletions doc/controls/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Controls

The maps on Google Maps contain UI elements for allowing user interaction through the map. These elements are known as
`controls` and you can include variations of these controls in your Google Maps API application. Alternatively, you
can do nothing and let the Google Maps API handle all control behavior.

The controls bag is accessible via:

``` php
$controls = $map->getControls();
```

1. [Map type control](/doc/controls/map_type.md)
2. [Overview](/doc/controls/overview.md)
3. [Pan](/doc/controls/pan.md)
4. [Rotate](/doc/controls/rotate.md)
5. [Scale](/doc/controls/scale.md)
6. [Street view](/doc/controls/street_view.md)
7. [Zoom](/doc/controls/zoom.md)
Loading

0 comments on commit 7fed5e8

Please sign in to comment.