' + soWidgetsGoogleMap.geocode.noResults + '
');
autoCompleteInit.reject();
});
}
}.bind(this));
}
autoCompleteInit.always(function(){
$('.sow-google-map-canvas').each(function (index, element) {
var $$ = $(element);
if( $$.data( 'initialized' ) ) {
// Already initialized so continue to next element.
return true;
}
var options = $$.data( 'options' );
var address = options.address;
// If no address was specified, but we have markers, use the first marker as the map center.
if(!address) {
var markers = options.markerPositions;
if(markers && markers.length) {
address = markers[0].place;
}
}
this.getLocation( address ).done(
function ( location ) {
this.showMap( $$.get( 0 ), location, options );
$$.data( 'initialized', true );
}.bind( this )
).fail( function () {
$$.append( '