@@ -169,3 +169,43 @@ google.maps.DropDownControl = function(options) {
169169 clearTimeout ( ctx . hideTimeout ) ;
170170 } ) ;
171171} ;
172+
173+ // simple status control
174+
175+ google . maps . StatusTextControl = function ( options ) {
176+ this . options = options || {
177+ text : "" ,
178+ map : null ,
179+ position : 0 ,
180+ fontSize : "10px" ,
181+ } ;
182+
183+ this . div_ = document . createElement ( 'div' ) ;
184+ this . div_ . style . cssText = "display: none" ;
185+ this . div_ . innerHTML = "<div style='opacity: 0.7; width: 100%; height: 100%; position: absolute;'>" +
186+ "<div style='width: 1px;'></div>" +
187+ "<div style='width: auto; height: 100%; margin-left: 1px; background-color: rgb(245, 245, 245);'></div></div>" ;
188+
189+ var div = document . createElement ( 'div' ) ;
190+ div . style . cssText = 'position: relative; padding-right: 6px; padding-left: 6px;' +
191+ ' font-family: Roboto, Arial, sans-serif; color: rgb(68, 68, 68);' +
192+ ' white-space: nowrap; direction: ltr; text-align: right;' +
193+ ' font-size: ' + this . options . fontSize ;
194+
195+ this . span_ = document . createElement ( 'span' ) ;
196+ div . appendChild ( this . span_ ) ;
197+ this . div_ . appendChild ( div ) ;
198+
199+ // update text
200+ this . setText ( this . options . text ) ;
201+
202+ // add control
203+ if ( this . options . map )
204+ this . options . map . controls [ options . position ] . push ( this . div_ ) ;
205+ } ;
206+
207+ google . maps . StatusTextControl . prototype . setText = function ( text ) {
208+ this . options . text = text ;
209+ this . span_ . innerHTML = text ;
210+ this . div_ . style . display = ( text === "" ) ? "none" : "block" ;
211+ } ;
0 commit comments