@@ -7,6 +7,7 @@ <h1 class="page-header">FAQ</h1>
7
7
< li > < a href ="#faq-map-instance "> How do I access the map instance?</ a > </ li >
8
8
< li > < a href ="#faq-map-height "> Can I dynamically set the map height?</ a > </ li >
9
9
< 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 >
10
11
< li > < a href ="#faq-map-partial-render "> My map is only partially rendering!</ a > </ li >
11
12
</ ul >
12
13
@@ -84,30 +85,30 @@ <h3 id="faq-map-height" class="faq-entry-title">Can I dynamically set the map he
84
85
*/
85
86
86
87
body, html {
87
- height: 100%;
88
- width: 100%;
88
+ height: 100%;
89
+ width: 100%;
89
90
}
90
91
.angular-google-map-container {
91
- height: 100%;
92
- width: 50%;
93
- position: absolute;
92
+ height: 100%;
93
+ width: 50%;
94
+ position: absolute;
94
95
}
95
96
96
97
.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;
101
102
}
102
103
103
104
/*
104
105
Use bootstraps container w/ some overrides, nice thing about this on bootstrap is there is
105
106
psuedo element with clearfix and display: table; , all after (which is why I know .middle works above)
106
107
*/
107
108
.container{
108
- width: 50%;
109
- padding-left: 0;
110
- padding-right: 0;
109
+ width: 50%;
110
+ padding-left: 0;
111
+ padding-right: 0;
111
112
}
112
113
</ div >
113
114
</ div >
@@ -122,17 +123,55 @@ <h3 id="faq-map-events-apply" class="faq-entry-title">Maps events are not workin
122
123
123
124
< div hljs >
124
125
$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
+ }
132
133
}
133
134
</ 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 >
134
173
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 >
136
175
137
176
< p > If rendering starts before elements are full size, google maps calculates according to the smaller size. This is most
138
177
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