Skip to content

Commit

Permalink
Merge pull request shramov#78 from fiskus/f/console.debug-fix
Browse files Browse the repository at this point in the history
Проверка на существование console
  • Loading branch information
brunob committed Sep 18, 2013
2 parents 971df39 + a49ab5e commit 8a39ad3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions layer/tile/Yandex.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,19 @@ L.Yandex = L.Class.extend({

// Check that ymaps.Map is ready
if (ymaps.Map === undefined) {
console.debug("L.Yandex: Waiting on ymaps.load('package.map')");
if (console) {
console.debug("L.Yandex: Waiting on ymaps.load('package.map')");
}
return ymaps.load(["package.map"], this._initMapObject, this);
}

// If traffic layer is requested check if control.TrafficControl is ready
if (this.options.traffic)
if (ymaps.control === undefined ||
ymaps.control.TrafficControl === undefined) {
console.debug("L.Yandex: loading traffic and controls");
ymaps.control.TrafficControl === undefined) {
if (console) {
console.debug("L.Yandex: loading traffic and controls");
}
return ymaps.load(["package.traffic", "package.controls"],
this._initMapObject, this);
}
Expand All @@ -117,7 +121,7 @@ L.Yandex = L.Class.extend({
this._type = new ymaps.MapType("null", []);
map.container.getElement().style.background = "transparent";
}
map.setType(this._type)
map.setType(this._type);

this._yandex = map;
this._update(true);
Expand Down Expand Up @@ -147,7 +151,7 @@ L.Yandex = L.Class.extend({
_resize: function(force) {
var size = this._map.getSize(), style = this._container.style;
if (style.width == size.x + "px" &&
style.height == size.y + "px")
style.height == size.y + "px")
if (force != true) return;
this.setElementSize(this._container, size);
var b = this._map.getBounds(), sw = b.getSouthWest(), ne = b.getNorthEast();
Expand Down

0 comments on commit 8a39ad3

Please sign in to comment.