()
| 40 | } |
| 41 | |
| 42 | private _getGeocoder(): Promise<google.maps.Geocoder> { |
| 43 | if (!this._geocoder) { |
| 44 | if (google.maps.Geocoder) { |
| 45 | this._geocoder = new google.maps.Geocoder(); |
| 46 | } else { |
| 47 | return google.maps.importLibrary('geocoding').then(lib => { |
| 48 | this._geocoder = new (lib as google.maps.GeocodingLibrary).Geocoder(); |
| 49 | return this._geocoder; |
| 50 | }); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | return Promise.resolve(this._geocoder); |
| 55 | } |
| 56 | } |