From 0a69b09a49e2074d43c13ffff150fdef0a6c5966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Gaujard?= Date: Tue, 24 Jan 2017 00:45:49 +0100 Subject: [PATCH 1/2] Init a composer library for use this awesome library as a CodeIgniter package + Add a MIT License + Add some index file for folder protection --- .gitignore | 3 +++ LICENSE | 21 +++++++++++++++++++ composer.json | 14 +++++++++++++ index.html | 11 ++++++++++ package/index.html | 11 ++++++++++ .../libraries/Googlemaps.php | 0 {application => package}/libraries/Jsmin.php | 0 7 files changed, 60 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 composer.json create mode 100755 index.html create mode 100755 package/index.html rename {application => package}/libraries/Googlemaps.php (100%) rename {application => package}/libraries/Jsmin.php (100%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9175647 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# COMPOSER +/composer.lock +/vendor/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8f0dd9b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 CodeIgniter-Google-Maps-V3-API-Library + +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 rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..482da4c --- /dev/null +++ b/composer.json @@ -0,0 +1,14 @@ +{ + "name": "biostall/code-igniter-google-maps-v3-api-library", + "description": "The library enables you to create a map and overlay multiple markers, polylines, polygons, rectangles, ground overlays and/or circles, all of which are fully customisable. The library also supports showing directions between two points, including the ability to show the textual directions alongside the map too, and marker clustering. The first stages of integration with the Google Places API are available for use too.", + "type": "library", + "license": "MIT", + "authors": [ + { + "name": "BIOSTALL", + "email": "info@biostall.com" + } + ], + "minimum-stability": "stable", + "require": {} +} diff --git a/index.html b/index.html new file mode 100755 index 0000000..b702fbc --- /dev/null +++ b/index.html @@ -0,0 +1,11 @@ + + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + + diff --git a/package/index.html b/package/index.html new file mode 100755 index 0000000..b702fbc --- /dev/null +++ b/package/index.html @@ -0,0 +1,11 @@ + + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + + diff --git a/application/libraries/Googlemaps.php b/package/libraries/Googlemaps.php similarity index 100% rename from application/libraries/Googlemaps.php rename to package/libraries/Googlemaps.php diff --git a/application/libraries/Jsmin.php b/package/libraries/Jsmin.php similarity index 100% rename from application/libraries/Jsmin.php rename to package/libraries/Jsmin.php From 41aead6a6651353ed3b72731765ff96584deb480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Gaujard?= Date: Wed, 25 Jan 2017 11:04:46 +0100 Subject: [PATCH 2/2] Add a method marker_icon to have different marker following this article : http://biostall.com/adding-number-or-letters-to-google-maps-api-markers/ --- package/libraries/Googlemaps.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/package/libraries/Googlemaps.php b/package/libraries/Googlemaps.php index 5f549f8..3115eb8 100644 --- a/package/libraries/Googlemaps.php +++ b/package/libraries/Googlemaps.php @@ -173,12 +173,22 @@ function initialize($config = array()) } if ($this->sensor) { $this->sensor = "true"; }else{ $this->sensor = "false"; } - + } - + + function marker_icon($symbol = '', $marker_color = 'FF0000', $font_color = '000000') + { + $url = '//chart.apis.google.com/chart?chst=d_map_pin_letter&chld='; + $url .= $symbol . '|'; + $url .= $marker_color . '|'; + $url .= $font_color; + + return $url; + } + function add_marker($params = array()) { - + $marker = array(); $this->markersInfo['marker_'.count($this->markers)] = array(); @@ -193,7 +203,7 @@ function add_marker($params = array()) $marker['icon_size'] = ''; // The display size of the sprite or image being used. When using sprites, you must specify the sprite size. Expecting two comma-separated values for width and height respectively (ie '20,30'). See https://developers.google.com/maps/documentation/javascript/3.exp/reference#Icon $marker['icon_scaledSize'] = ''; // The size of the entire image after scaling, if any. Use this property to stretch/shrink an image or a sprite. Expecting two comma-separated values for width and height respectively (ie '20,30') $marker['icon_origin'] = ''; // If using a sprite, the position of the image within the sprite. Expecting two comma-separated values for distance from the top and left respectively (ie '20,30') - $marker['icon_anchor'] = ''; // The position at which to anchor an image in correspondance to the location of the marker on the map. By default, the anchor is located along the center point of the bottom of the image. Expecting two comma-separated values (ie '20,30'). Credit to https://github.com/colethorsen + $marker['icon_anchor'] = ''; // The position at which to anchor an image in correspondence to the location of the marker on the map. By default, the anchor is located along the center point of the bottom of the image. Expecting two comma-separated values (ie '20,30'). Credit to https://github.com/colethorsen $marker['animation'] = ''; // blank, 'DROP' or 'BOUNCE' $marker['onclick'] = ''; // JavaScript performed when a marker is clicked $marker['ondblclick'] = ''; // JavaScript performed when a marker is double-clicked