@@ -32,7 +32,7 @@ com.stamen.osm.POLYGON_TAGS = {
32
32
33
33
com . stamen . osm . OSM = function ( responseXML ) {
34
34
35
- if ( console && console . log ) console . log ( 'initing OSM object...' ) ;
35
+ if ( window . console && window . console . log ) console . log ( 'initing OSM object...' ) ;
36
36
var t = new Date ( ) . getTime ( ) ;
37
37
38
38
this . nodes = [ ] ;
@@ -49,7 +49,7 @@ com.stamen.osm.OSM = function(responseXML) {
49
49
maxLon : parseFloat ( boundsXML . attributes . getNamedItem ( 'maxlon' ) . value )
50
50
} ;
51
51
52
- if ( console && console . log ) console . log ( 'got bounds ' + this . bounds ) ;
52
+ if ( window . console && window . console . log ) console . log ( 'got bounds ' + this . bounds ) ;
53
53
54
54
// so we only have to loop over the xml nodes once
55
55
// (for when we're parsing node refs in ways)
@@ -76,7 +76,7 @@ com.stamen.osm.OSM = function(responseXML) {
76
76
nodeHash [ id ] = node ;
77
77
}
78
78
79
- if ( console && console . log ) console . log ( 'got ' + this . nodes . length + ' nodes' ) ;
79
+ if ( window . console && window . console . log ) console . log ( 'got ' + this . nodes . length + ' nodes' ) ;
80
80
81
81
var wayXMLs = responseXML . getElementsByTagName ( "way" ) ;
82
82
for ( var i = 0 ; i < wayXMLs . length ; i ++ ) {
@@ -92,7 +92,7 @@ com.stamen.osm.OSM = function(responseXML) {
92
92
coordinates . push ( theNode . geometry . coordinates ) ;
93
93
}
94
94
else {
95
- if ( console && console . log ) console . log ( 'node ref ' + ref + ' not found' ) ;
95
+ if ( window . console && window . console . log ) console . log ( 'node ref ' + ref + ' not found' ) ;
96
96
}
97
97
}
98
98
@@ -118,10 +118,10 @@ com.stamen.osm.OSM = function(responseXML) {
118
118
119
119
} // for each way
120
120
121
- if ( console && console . log ) console . log ( 'got ' + this . ways . length + ' ways' ) ;
122
- if ( console && console . log ) console . log ( 'got ' + this . areas . length + ' areas' ) ;
121
+ if ( window . console && window . console . log ) console . log ( 'got ' + this . ways . length + ' ways' ) ;
122
+ if ( window . console && window . console . log ) console . log ( 'got ' + this . areas . length + ' areas' ) ;
123
123
124
- if ( console && console . log ) console . log ( 'done initing OSM object... ' + ( new Date ( ) . getTime ( ) - t ) + ' ms' ) ;
124
+ if ( window . console && window . console . log ) console . log ( 'done initing OSM object... ' + ( new Date ( ) . getTime ( ) - t ) + ' ms' ) ;
125
125
126
126
} ;
127
127
0 commit comments