Skip to content

Commit

Permalink
v1.2.4
Browse files Browse the repository at this point in the history
[Improved] The address input automatically updates the map after paste
  • Loading branch information
Tam committed Aug 9, 2016
1 parent 2f0f2d0 commit 1932060
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ You can access your browser API key in templates using `craft.simpleMap.apiKey`.

## Changelog

### 1.2.4
- The address input automatically updates the map after paste

### 1.2.3
- Browser API key can now be accessed in templates

Expand Down
2 changes: 1 addition & 1 deletion SimpleMapPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function getDescription()

public function getVersion()
{
return '1.2.3';
return '1.2.4';
}

public function getSchemaVersion()
Expand Down
8 changes: 8 additions & 0 deletions releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,13 @@
"notes": [
"- Browser API key can now be accessed in templates"
]
},
{
"version": "1.2.4",
"downloadUrl": "https://github.com/ethercreative/SimpleMap/archive/v1.2.4.zip",
"date": "2016-08-09T10:00:00-08:00",
"notes": [
"[Improved] The address input automatically updates the map after paste"
]
}
]
9 changes: 8 additions & 1 deletion resources/SimpleMap_Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ SimpleMap.prototype.setupMap = function () {
autocomplete.map = this.map;
autocomplete.bindTo('bounds', this.map);

// Update map on paste
this.address.addEventListener('paste', function () {
setTimeout(function () {
google.maps.event.trigger(autocomplete, 'place_changed');
}, 1);
});

this.address.addEventListener('input', function () {
if (this.value === '') self.clear();
});
Expand Down Expand Up @@ -159,7 +166,7 @@ SimpleMap.prototype.setupMap = function () {
// If we have a place
var place = this.getPlace();

if (place.geometry) {
if (place && place.geometry) {
lat = place.geometry.location.lat();
lng = place.geometry.location.lng();

Expand Down

0 comments on commit 1932060

Please sign in to comment.