From 23b5cefa9cb50947996a6a72aa06c21273ae11e3 Mon Sep 17 00:00:00 2001 From: Tam Date: Wed, 20 Apr 2016 15:55:41 +0100 Subject: [PATCH] Merged #2 & #3, Additional changes for v1.1.0 --- README.md | 8 +++++++- SimpleMapPlugin.php | 2 +- releases.json | 11 +++++++++++ resources/SimpleMap_Map.js | 5 +++-- templates/map-fieldtype.twig | 8 ++++---- 5 files changed, 26 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index fef3d7d..01a3b7c 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,18 @@ Clone this repo into `craft/plugins/simplemap`. ## Usage Create the field as you would any other. -The field type will return an array containing `lat`, `lng`, and `address`. This means you can use `{{ myMapField.lat }}`. +The field type will return an array containing `lat`, `lng`, `zoom`, and `address`. This means you can use `{{ myMapField.lat }}`. ![How it looks](resources/preview.png) ## Changelog +### 1.1.0 +- Merged \#2 & \#3 from @cballenar +- \#2 - Field now stores map zoom +- \#3 - Improved handling of unknown locations +- Improved error message display + ### 1.0.2 - Added link to docs - Added releases json for updates diff --git a/SimpleMapPlugin.php b/SimpleMapPlugin.php index 38c6ef6..62a3d81 100644 --- a/SimpleMapPlugin.php +++ b/SimpleMapPlugin.php @@ -24,7 +24,7 @@ public function getDescription() public function getVersion() { - return '1.0.2'; + return '1.1.0'; } public function getSchemaVersion() diff --git a/releases.json b/releases.json index c25e6ff..bb58d1d 100644 --- a/releases.json +++ b/releases.json @@ -23,5 +23,16 @@ "Added link to docs", "Added releases json for updates" ] + }, + { + "version": "1.1.0", + "downloadUrl": "https://github.com/ethercreative/SimpleMap/archive/v1.1.0.zip", + "date": "2016-04-20T10:00:00-08:00", + "notes": [ + "Merged #2 & #3 from https://github.com/cballenar", + "#2 - Added zoom", + "#3 - Improved handling of unknown locations", + "Improved error message display" + ] } ] \ No newline at end of file diff --git a/resources/SimpleMap_Map.js b/resources/SimpleMap_Map.js index c39b36a..70227cf 100644 --- a/resources/SimpleMap_Map.js +++ b/resources/SimpleMap_Map.js @@ -47,7 +47,8 @@ var SimpleMap = function (mapId, settings) { }; SimpleMap.Fail = function (message) { - if (window.console) console.error('SimpleMap:', message); + Craft.cp.displayError('SimpleMap: ' + message); + if (window.console) console.error.apply(console, ['%cSimpleMap: %c' + message, 'font-weight:bold;','font-weight:normal;']); }; SimpleMap.LoadGoogleAPI = function () { @@ -124,7 +125,7 @@ SimpleMap.prototype.setupMap = function () { // Update map to saved zoom this.map.setZoom(parseInt(zoom)); - // When the autocomplete place changes + // When the auto-complete place changes google.maps.event.addListener(autocomplete, 'place_changed', function () { var address = self.address.value, lat, lng; self.inputs.address.value = address; diff --git a/templates/map-fieldtype.twig b/templates/map-fieldtype.twig index b15847d..90da5ad 100644 --- a/templates/map-fieldtype.twig +++ b/templates/map-fieldtype.twig @@ -9,7 +9,7 @@
- - - - + + + + \ No newline at end of file