Skip to content

Commit 3088315

Browse files
committed
Merge pull request angular-ui#1474 from kandizzy/master
Fix for issue angular-ui#1471, searchbox visibility
2 parents 2b5245a + c22ce6b commit 3088315

File tree

8 files changed

+23
-7
lines changed

8 files changed

+23
-7
lines changed

dist/angular-google-maps-street-view.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! angular-google-maps 2.1.6 2015-09-03
1+
/*! angular-google-maps 2.1.6 2015-09-04
22
* AngularJS directives for Google Maps
33
* git: https://github.com/angular-ui/angular-google-maps.git
44
*/

dist/angular-google-maps-street-view_dev_mapped.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-google-maps.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! angular-google-maps 2.1.6 2015-09-03
1+
/*! angular-google-maps 2.1.6 2015-09-04
22
* AngularJS directives for Google Maps
33
* git: https://github.com/angular-ui/angular-google-maps.git
44
*/
@@ -5379,6 +5379,9 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi
53795379
} else {
53805380
this.addAsMapControl();
53815381
}
5382+
if (!this.visible) {
5383+
this.setVisibility(this.visible);
5384+
}
53825385
if (this.autocomplete) {
53835386
this.listener = google.maps.event.addListener(this.gObject, 'place_changed', (function(_this) {
53845387
return function() {

dist/angular-google-maps_dev_mapped.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! angular-google-maps 2.1.6 2015-09-03
1+
/*! angular-google-maps 2.1.6 2015-09-04
22
* AngularJS directives for Google Maps
33
* git: https://github.com/angular-ui/angular-google-maps.git
44
*/
@@ -5379,6 +5379,9 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi
53795379
} else {
53805380
this.addAsMapControl();
53815381
}
5382+
if (!this.visible) {
5383+
this.setVisibility(this.visible);
5384+
}
53825385
if (this.autocomplete) {
53835386
this.listener = google.maps.event.addListener(this.gObject, 'place_changed', (function(_this) {
53845387
return function() {

dist/angular-google-maps_dev_mapped.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/assets/scripts/controllers/search-box.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ angular.module("search-box-example", ['uiGmapgoogle-maps'])
2424
, function ($scope, $timeout, $log, $http, GoogleMapApi) {
2525
$log.doLog = true
2626

27+
$scope.toggleMap = function () {
28+
$scope.searchbox.options.visible = !$scope.searchbox.options.visible
29+
}
30+
2731
GoogleMapApi.then(function(maps) {
2832
maps.visualRefresh = true;
2933
$scope.defaultBounds = new google.maps.LatLngBounds(
@@ -84,7 +88,8 @@ angular.module("search-box-example", ['uiGmapgoogle-maps'])
8488
//position:'top-right',
8589
position:'top-left',
8690
options: {
87-
bounds: {}
91+
bounds: {},
92+
visible: true
8893
},
8994
//parentdiv:'searchBoxParent',
9095
events: {

example/search-box.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
events="searchbox.events" position="searchbox.position"></ui-gmap-search-box>
3131

3232
<!--to add to a parent div-->
33-
<!--<ui-gmap-search-box options="searchbox.options" template="searchbox.template" events="searchbox.events" parentdiv="searchbox.parentdiv"></ui-gmap-search-box>-->
33+
<!-- <ui-gmap-search-box options="searchbox.options" template="searchbox.template" events="searchbox.events" parentdiv="searchbox.parentdiv"></ui-gmap-search-box> -->
3434

3535

3636
<ui-gmap-markers idkey="map.idkey" models="map.markers" coords="'self'" icon="'icon'"
@@ -43,6 +43,8 @@
4343

4444

4545
</ui-gmap-google-map>
46+
<button type="button" ng-click="toggleMap()">Toggle Visibility</button>
47+
<span ng-bind="searchbox.options.visible"></span>
4648
</div>
4749
</div>
4850
<script src="../website_libs/dev_deps.js"></script>

src/coffee/directives/api/models/parent/search-box-parent-model.coffee

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ angular.module('uiGmapgoogle-maps.directives.api.models.parent')
4545
else
4646
@addAsMapControl()
4747

48+
if not @visible
49+
@setVisibility(@visible)
50+
4851
if @autocomplete
4952
@listener = google.maps.event.addListener @gObject, 'place_changed', =>
5053
@places = @gObject.getPlace()

0 commit comments

Comments
 (0)