Skip to content

Commit de1820f

Browse files
committed
Updates
1 parent 4085879 commit de1820f

File tree

1 file changed

+59
-20
lines changed

1 file changed

+59
-20
lines changed

views/faq.html

Lines changed: 59 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ <h1 class="page-header">FAQ</h1>
77
<li><a href="#faq-map-instance">How do I access the map instance?</a></li>
88
<li><a href="#faq-map-height">Can I dynamically set the map height?</a></li>
99
<li><a href="#faq-map-events-apply">Map events are not working!</a></li>
10+
<li><a href="#faq-multiple-windows">How do I only open one window at a time?</a></li>
1011
<li><a href="#faq-map-partial-render">My map is only partially rendering!</a></li>
1112
</ul>
1213

@@ -84,30 +85,30 @@ <h3 id="faq-map-height" class="faq-entry-title">Can I dynamically set the map he
8485
*/
8586

8687
body, html {
87-
height: 100%;
88-
width: 100%;
88+
height: 100%;
89+
width: 100%;
8990
}
9091
.angular-google-map-container {
91-
height: 100%;
92-
width: 50%;
93-
position: absolute;
92+
height: 100%;
93+
width: 50%;
94+
position: absolute;
9495
}
9596

9697
.middle {
97-
display: table;
98-
width: 50%;
99-
margin-left: auto;
100-
margin-right: auto;
98+
display: table;
99+
width: 50%;
100+
margin-left: auto;
101+
margin-right: auto;
101102
}
102103

103104
/*
104105
Use bootstraps container w/ some overrides, nice thing about this on bootstrap is there is
105106
psuedo element with clearfix and display: table; , all after (which is why I know .middle works above)
106107
*/
107108
.container{
108-
width: 50%;
109-
padding-left: 0;
110-
padding-right: 0;
109+
width: 50%;
110+
padding-left: 0;
111+
padding-right: 0;
111112
}
112113
</div>
113114
</div>
@@ -122,17 +123,55 @@ <h3 id="faq-map-events-apply" class="faq-entry-title">Maps events are not workin
122123

123124
<div hljs>
124125
$scope.map = {
125-
events: {
126-
tilesloaded: function (map) {
127-
$scope.$apply(function () {
128-
$scope.mapInstance = map;
129-
});
130-
}
131-
}
126+
events: {
127+
tilesloaded: function (map) {
128+
$scope.$apply(function () {
129+
$scope.mapInstance = map;
130+
});
131+
}
132+
}
132133
}
133134
</div>
135+
<h3 id="faq-map-partial-render" class="faq-entry-title">How do I only open one window at a time?</h3>
136+
<p>Most likely this is a symptom of using the 'windows' directive when all you really need is the 'window' directive.
137+
The 'windows' directive has efficiency advantages over 'window' <i>when you are display a large number of windows simultaneously.</i>
138+
If only one window at a time is needed, then use 'window' and change out the bindings. One method of accomplishing this is outlined below:
139+
</p>
140+
<div hljs>
141+
<ui-gmap-google-map center="map.center" zoom="map.zoom">
142+
<ui-gmap-window show="map.window.show" coords="map.window.model" options="map.window.options" closeclick="map.window.closeClick()">
143+
<div ng-non-bindable>test</div>
144+
</ui-gmap-window>
145+
<ui-gmap-markers idkey="'bid'" models="map.markers" coords="'self'" docluster="false" fit="'true'" icon="'icon'" events="map.markersEvents" options="'options'"></ui-gmap-markers>
146+
</ui-gmap-google-map>
147+
</div>
148+
149+
<div hljs>
150+
$scope.map = {
151+
center: {
152+
latitude: 50.6278,
153+
longitude: 3.0583
154+
},
155+
zoom: 12,
156+
markers: [], // array of models to display
157+
markersEvents: {
158+
click: function(marker, eventName, model, arguments) {
159+
$scope.map.window.model = model;
160+
$scope.map.window.show = true;
161+
}
162+
},
163+
window: {
164+
marker: {},
165+
show: false,
166+
closeClick: function() {
167+
this.show = false;
168+
},
169+
options: {} // define when map is ready
170+
}
171+
};
172+
</div>
134173

135-
<h3 id="faq-map-partial-render" class="faq-entry-title">My map is only partially rendering!</h3>
174+
<h3 id="faq-multiple-windows" class="faq-entry-title">My map is only partially rendering!</h3>
136175

137176
<p>If rendering starts before elements are full size, google maps calculates according to the smaller size. This is most
138177
commonly the case with a hidden element (eg, ng-show). To fix this, use "ng-if" instead, as this will wait to attach

0 commit comments

Comments
 (0)