Skip to content

Commit

Permalink
[2.0] Refactor core
Browse files Browse the repository at this point in the history
  • Loading branch information
GeLoLabs committed Oct 29, 2014
1 parent f49a8e4 commit 437ab4a
Show file tree
Hide file tree
Showing 625 changed files with 53,002 additions and 25,153 deletions.
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.
24 changes: 18 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,29 @@
],
"require": {
"php": ">=5.3.0",
"egeloen/json-builder": "~1.0.0"
"egeloen/json-builder": "~1.0.0",
"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/" }
Expand Down
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)
60 changes: 60 additions & 0 deletions doc/controls/map_type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Map type control

The map type control lets the user toggle between map types (such as ROADMAP and SATELLITE). This control appears by
default in the top right corner of the map.

## Build your map type control

``` php
use Ivory\GoogleMap\Controls\MapTypeControl;

$mapTypeControl = new MapTypeControl();
```

## Configure the map type control

### Configure the map type control IDs

``` php
use Ivory\GoogleMap\MapTypeId;

$mapTypeControl->addMapTypeId(MapTypeId::HYBRID);
$mapTypeControl->addMapTypeId(MapTypeId::ROADMAP);
$mapTypeControl->addMapTypeId(MapTypeId::SATELLITE);
$mapTypeControl->addMapTypeId(MapTypeId::TERRAIN);
```

### Configure the map type control position

``` php
use Ivory\GoogleMap\Controls\ControlPosition;

$mapTypeControl->setControlPosition(ControlPosition::TOP_LEFT);
$mapTypeControl->setControlPosition(ControlPosition::TOP_CENTER);
$mapTypeControl->setControlPosition(ControlPosition::TOP_RIGHT);
$mapTypeControl->setControlPosition(ControlPosition::LEFT_TOP);
$mapTypeControl->setControlPosition(ControlPosition::LEFT_CENTER);
$mapTypeControl->setControlPosition(ControlPosition::LEFT_BOTTOM);
$mapTypeControl->setControlPosition(ControlPosition::RIGHT_TOP);
$mapTypeControl->setControlPosition(ControlPosition::RIGHT_CENTER);
$mapTypeControl->setControlPosition(ControlPosition::RIGHT_BOTTOM);
$mapTypeControl->setControlPosition(ControlPosition::BOTTOM_LEFT);
$mapTypeControl->setControlPosition(ControlPosition::BOTTOM_CENTER);
$mapTypeControl->setControlPosition(ControlPosition::BOTTOM_RIGHT);
```

### Configure the map type control style

``` php
use Ivory\GoogleMap\Controls\MapTypeControlStyle;

$mapTypeControl->setMapTypeControlStyle(MapTypeControlStyle::DEFAULT_);
$mapTypeControl->setMapTypeControlStyle(MapTypeControlStyle::DROPDOWN_MENU);
$mapTypeControl->setMapTypeControlStyle(MapTypeControlStyle::HORIZONTAL_BAR);
```

## Set your map type control on the map

``` php
$map->getControls()->setMapTypeControl($mapTypeControl);
```
19 changes: 9 additions & 10 deletions doc/usage/controls/overview.md → doc/controls/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,18 @@ This control appears by default in the bottom right corner of the map, and is by
use Ivory\GoogleMap\Controls\OverviewMapControl;

$overviewMapControl = new OverviewMapControl();

// Configure your overview map control
$overviewMapControl->setOpened(false);
```

## Add your overview map control to the map
## Configure your overview map control

``` php
use Ivory\GoogleMap\Controls\OverviewMapControl;
### Configure the initial open state

$overviewMapControl = new OverviewMapControl();
```
$overviewMapControl->setOpened(true);
```

// Add your overview map control to the map
$map->setOverviewMapControl($overviewMapControl);
$map->setOverviewMapControl(false);
## Set your overview map control on the map

``` php
$map->getControls()->setOverviewMapControl($overviewMapControl);
```
39 changes: 39 additions & 0 deletions doc/controls/pan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Pan control

The Pan control displays buttons for panning the map. This control appears by default in the top left corner of the
map on non-touch devices. The Pan control also allows you to rotate 45° imagery, if available.

## Build your pan control

``` php
use Ivory\GoogleMap\Controls\PanControl;

$panControl = new PanControl();
```

## Configure the pan control

### Configure the pan control position

``` php
use Ivory\GoogleMap\Controls\ControlPosition;

$panControl->setControlPosition(ControlPosition::TOP_LEFT);
$panControl->setControlPosition(ControlPosition::TOP_CENTER);
$panControl->setControlPosition(ControlPosition::TOP_RIGHT);
$panControl->setControlPosition(ControlPosition::LEFT_TOP);
$panControl->setControlPosition(ControlPosition::LEFT_CENTER);
$panControl->setControlPosition(ControlPosition::LEFT_BOTTOM);
$panControl->setControlPosition(ControlPosition::RIGHT_TOP);
$panControl->setControlPosition(ControlPosition::RIGHT_CENTER);
$panControl->setControlPosition(ControlPosition::RIGHT_BOTTOM);
$panControl->setControlPosition(ControlPosition::BOTTOM_LEFT);
$panControl->setControlPosition(ControlPosition::BOTTOM_CENTER);
$panControl->setControlPosition(ControlPosition::BOTTOM_RIGHT);
```

## Set your pan control on the map

``` php
$map->getControls()->setPanControl($panControl);
```
39 changes: 39 additions & 0 deletions doc/controls/rotate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Rotate control

The Rotate control contains a small circular icon which allows you to rotate maps containing oblique imagery. This
control appears by default in the top left corner of the map.

## Build your rotate control

``` php
use Ivory\GoogleMap\Controls\RotateControl;

$rotateControl = new RotateControl();
```

## Configure the rotate control

### Configure the rotate control position

``` php
use Ivory\GoogleMap\Controls\ControlPosition;

$rotateControl->setControlPosition(ControlPosition::TOP_LEFT);
$rotateControl->setControlPosition(ControlPosition::TOP_CENTER);
$rotateControl->setControlPosition(ControlPosition::TOP_RIGHT);
$rotateControl->setControlPosition(ControlPosition::LEFT_TOP);
$rotateControl->setControlPosition(ControlPosition::LEFT_CENTER);
$rotateControl->setControlPosition(ControlPosition::LEFT_BOTTOM);
$rotateControl->setControlPosition(ControlPosition::RIGHT_TOP);
$rotateControl->setControlPosition(ControlPosition::RIGHT_CENTER);
$rotateControl->setControlPosition(ControlPosition::RIGHT_BOTTOM);
$rotateControl->setControlPosition(ControlPosition::BOTTOM_LEFT);
$rotateControl->setControlPosition(ControlPosition::BOTTOM_CENTER);
$rotateControl->setControlPosition(ControlPosition::BOTTOM_RIGHT);
```

## Set your rotate control on the map

``` php
$map->getControls()->setRotateControl($rotateControl);
```

0 comments on commit 437ab4a

Please sign in to comment.