зеркало из https://github.com/mozilla/popcorn-js.git
Merge pull request #108 from cadecairos/t1162
Add existence check for newdiv variable in googlemap ready callback [#11...
This commit is contained in:
Коммит
c25078ef00
|
@ -150,21 +150,23 @@ var googleCallback;
|
||||||
// before setting up the map parameters
|
// before setting up the map parameters
|
||||||
var isMapReady = function () {
|
var isMapReady = function () {
|
||||||
if ( _mapLoaded ) {
|
if ( _mapLoaded ) {
|
||||||
if ( options.location ) {
|
if ( newdiv ) {
|
||||||
// calls an anonymous google function called on separate thread
|
if ( options.location ) {
|
||||||
geocoder.geocode({
|
// calls an anonymous google function called on separate thread
|
||||||
"address": options.location
|
geocoder.geocode({
|
||||||
}, function ( results, status ) {
|
"address": options.location
|
||||||
if ( status === google.maps.GeocoderStatus.OK ) {
|
}, function ( results, status ) {
|
||||||
options.lat = results[ 0 ].geometry.location.lat();
|
if ( status === google.maps.GeocoderStatus.OK ) {
|
||||||
options.lng = results[ 0 ].geometry.location.lng();
|
options.lat = results[ 0 ].geometry.location.lat();
|
||||||
location = new google.maps.LatLng( options.lat, options.lng );
|
options.lng = results[ 0 ].geometry.location.lng();
|
||||||
map = buildMap( options, location, newdiv );
|
location = new google.maps.LatLng( options.lat, options.lng );
|
||||||
}
|
map = buildMap( options, location, newdiv );
|
||||||
});
|
}
|
||||||
} else {
|
});
|
||||||
location = new google.maps.LatLng( options.lat, options.lng );
|
} else {
|
||||||
map = buildMap( options, location, newdiv );
|
location = new google.maps.LatLng( options.lat, options.lng );
|
||||||
|
map = buildMap( options, location, newdiv );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче