Skip to content

Commit

Permalink
[2.0] Refactor core (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
GeLoLabs committed Aug 12, 2016
1 parent 9770a3f commit c39c5f3
Show file tree
Hide file tree
Showing 741 changed files with 42,420 additions and 33,915 deletions.
3 changes: 0 additions & 3 deletions .coveralls.yml

This file was deleted.

13 changes: 3 additions & 10 deletions .gitignore
@@ -1,12 +1,5 @@
# Composer
/bin
/.php_cs.cache
/build
/composer.lock
/vendor

# PHPUnit
/phpunit.xml
/clover.xml
/report

# Coveralls
/coveralls.json
/vendor
20 changes: 20 additions & 0 deletions .php_cs
@@ -0,0 +1,20 @@
<?php

use Symfony\CS\Config\Config;
use Symfony\CS\Finder\DefaultFinder;

$finder = DefaultFinder::create()
->in([
__DIR__.'/src',
__DIR__.'/tests',
]);

return Config::create()
->setUsingCache(true)
->fixers([
'align_double_arrow',
'short_array_syntax',
'ordered_use',
'-psr0',
])
->finder($finder);
28 changes: 11 additions & 17 deletions .travis.yml
@@ -1,24 +1,18 @@
language: php

php:
- 5.3.3
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm
- hhvm-nightly

before_script: composer install --prefer-source
before_script:
- export DISPLAY=:99
- /sbin/start-stop-daemon -Sbmq -p /tmp/xvfb_99.pid -x /usr/bin/Xvfb -- ${DISPLAY} -ac -screen 0, 1600x1200x24
- curl http://selenium-release.storage.googleapis.com/2.48/selenium-server-standalone-2.48.0.jar > selenium.jar
- curl http://chromedriver.storage.googleapis.com/2.12/chromedriver_linux64.zip > chromedriver.zip
- unzip chromedriver.zip
- java -jar selenium.jar -Dwebdriver.chrome.driver=./chromedriver > /dev/null 2>&1 &
- composer self-update
- composer install --prefer-source

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

after_script: bin/coveralls

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

notifications:
email: geloen.eric@gmail.com
script: vendor/bin/phpunit --configuration phpunit.travis.xml
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2011-2014 Eric GELOEN
Copyright (c) 2011-2016 Eric GELOEN

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
Expand Down
90 changes: 49 additions & 41 deletions README.md
@@ -1,57 +1,65 @@
# README

[![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)
[![Build Status](https://travis-ci.org/egeloen/ivory-google-map.svg?branch=master)](http://travis-ci.org/egeloen/ivory-google-map)
[![Code Coverage](https://scrutinizer-ci.com/g/egeloen/ivory-google-map/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/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:ckeditor-bundle/badge.svg)](http://www.versioneye.com/php/egeloen:ckeditor-bundle)

The Ivory Google Map project provides a Google Map integration for your PHP 5.3+ Project. It allows you to manage 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.6+ project. It allows you to manage map,
controls, overlays, events & 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)
- [Controls](/doc/control/index.md)
- [Map type](/doc/control/map_type.md)
- [Rotate](/doc/control/rotate.md)
- [Scale](/doc/control/scale.md)
- [Street view](/doc/control/street_view.md)
- [Zoom](/doc/control/zoom.md)
- [Events](/doc/event.md)
- [Layers](/doc/layer/index.md)
- [Kml Layer](/doc/layer/kml_layer.md)
- [Overlays](/doc/overlay/index.md)
- [Marker](/doc/overlay/marker.md)
- [Info Window](/doc/overlay/info_window.md)
- [Info Box](/doc/overlay/info_box.md)
- [Polyline](/doc/overlay/polyline.md)
- [Encoded Polyline](/doc/overlay/encoded_polyline.md)
- [Polygon](/doc/overlay/polygon.md)
- [Rectangle](/doc/overlay/rectangle.md)
- [Circle](/doc/overlay/circle.md)
- [Ground Overlay](/doc/overlay/ground_overlay.md)
- [Marker Clusterer](/doc/overlay/marker_clusterer.md)
- [Places](/doc/place/index.md)
- [Autocomplete](/doc/place/autocomplete.md)
- [Rendering](/doc/helper/index.md)
- [Map Rendering](/doc/helper/map.md)
- [Places Autocomplete Rendering](/doc/helper/place_autocomplete.md)
- [API Rendering](/doc/helper/api.md)
- [Services](/doc/service/index.md)
- [Directions](/doc/service/directions/directions.md)
- [Distance Matrix](/doc/service/distance_matrix/distance_matrix.md)
- [Geocoder](/doc/service/geocoder/geocoder.md)
- [Business Account](/doc/service/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 bundle 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
## Contribute

We love contributors! Ivory is an open source project. If you'd like to contribute, feel free to propose a PR!
We love contributors! Ivory is an open source project. If you'd like to contribute, feel free to propose a PR!.

## 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.
2 changes: 1 addition & 1 deletion UPGRADE.md → UPGRADE-1.0.md
@@ -1,4 +1,4 @@
# UPGRADE
# UPGRADE 1.0

### 1.3 to 1.4

Expand Down
6 changes: 6 additions & 0 deletions UPGRADE-2.0.md
@@ -0,0 +1,6 @@
# UPGRADE 2.0

### 1.x to 2.x

The library has mostly been rewrite, so please consider re-reading the documentation for the potential BC breaks in
your code.
40 changes: 27 additions & 13 deletions composer.json
@@ -1,7 +1,7 @@
{
"name": "egeloen/google-map",
"description": "Google Map API v3 integration for PHP 5.3+",
"keywords": [ "google map" ],
"description": "Google Map API v3 integration for PHP 5.6+",
"keywords": [ "google", "map" ],
"license": "MIT",
"authors": [
{
Expand All @@ -10,28 +10,42 @@
}
],
"require": {
"php": ">=5.3.0",
"egeloen/json-builder": "~1.0.0"
"php": "^5.6|^7.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"widop/http-adapter": "~1.1.0",
"willdurand/geocoder": "~2.0",
"satooshi/php-coveralls": "~0.6"
"egeloen/json-builder": "^2.0",
"friendsofphp/php-cs-fixer": "^1.11",
"php-http/cache-plugin": "dev-respect-headers",
"php-http/guzzle6-adapter": "^1.1",
"php-http/message": "^1.3",
"phpunit/phpunit": "^5.0",
"phpunit/phpunit-selenium": "^3.0",
"symfony/cache": "^3.0",
"symfony/event-dispatcher": "^2.0|^3.0",
"willdurand/geocoder": "^3.0"
},
"suggest": {
"widop/http-adapter": "Allows to use services",
"willdurand/geocoder": "Allows to use geocoding service"
"egeloen/json-builder": "Allows to use map service",
"php-http/client-implementation": "Allows to use http services",
"php-http/message": "Allows to use http services",
"symfony/event-dispatcher": "Allow to use map service",
"willdurand/geocoder": "Allows to use geocoder service"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/egeloen/cache-plugin.git"
}
],
"autoload": {
"psr-4": { "Ivory\\GoogleMap\\": "src/" }
},
"config": {
"bin-dir": "bin/"
"autoload-dev": {
"psr-4": { "Ivory\\Tests\\GoogleMap\\": "tests/" }
},
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
"dev-master": "2.0-dev"
}
}
}
11 changes: 11 additions & 0 deletions doc/control/index.md
@@ -0,0 +1,11 @@
# 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.

- [Map Type](/doc/control/map_type.md)
- [Rotate](/doc/control/rotate.md)
- [Scale](/doc/control/scale.md)
- [Street View](/doc/control/street_view.md)
- [Zoom](/doc/control/zoom.md)
69 changes: 69 additions & 0 deletions doc/control/map_type.md
@@ -0,0 +1,69 @@
# 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

First of all, if you want to render a map type control, you will need to build one. So let's go:

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

$mapTypeControl = new MapTypeControl();
```

The map type control constructor does not require anything but it accepts parameters such as ids (default roadmap,
satellite), position (default top right) and style (default default):

``` php
use Ivory\GoogleMap\Control\ControlPosition;
use Ivory\GoogleMap\Control\MapTypeControl;
use Ivory\GoogleMap\Control\MapTypeControlStyle;
use Ivory\GoogleMap\MapTypeId;

$mapTypeControl = new MapTypeControl(
[MapTypeId::ROADMAP, MapTypeId::SATELLITE],
ControlPosition::TOP_RIGHT,
MapTypeControlStyle::DEFAULT_
);
```

## Configure ids

If you want to update ids, you can use:

``` php
use Ivory\GoogleMap\MapTypeId;

$mapTypeControl->setIds([MapTypeId::ROADMAP, MapTypeId::SATELLITE]);
```

## Configure position

If you want to update position, you can use:

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

$mapTypeControl->setPosition(ControlPosition::TOP_RIGHT);
```

## Configure style

If you want to update the style, you can use:

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

$mapTypeControl->setStyle(MapTypeControlStyle::DEFAULT_);
```


## Append to a map

After building your map type control, you need to add it to a map with:

``` php
$map->getControlManager()->setMapTypeControl($mapTypeControl);
```
41 changes: 41 additions & 0 deletions doc/control/rotate.md
@@ -0,0 +1,41 @@
# 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

First of all, if you want to render a rotate control, you will need to build one. So let's go:

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

$rotateControl = new RotateControl();
```

The rotate control constructor does not require anything but it accepts parameters such as position (default top left):

``` php
use Ivory\GoogleMap\Control\ControlPosition;
use Ivory\GoogleMap\Control\RotateControl;

$rotateControl = new RotateControl(ControlPosition::TOP_LEFT);
```

## Configure position

If you want to update the rotate control position, you can use:

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

$rotateControl->setPosition(ControlPosition::TOP_RIGHT);
```

## Append to a map

After building your rotate control, you need to add it to a map with:

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

0 comments on commit c39c5f3

Please sign in to comment.