if (window.location.hash != '') {
var hash = window.location.hash.substr(1);
pm = ymaps.geoQuery(myGeoObjects).search('properties.name == "' + hash + '"').getCenter(myMap);
myMap.setCenter(pm);
}
objects = function (a,b) {
var c = {},
key;
for (key in a) {
if (a.hasOwnProperty(key)) {
c[key] = key in b ? b[key] : a[key];
}
}
return c;
}
var globalState = 0;
function onEvent1() {
++globalState;
myMethod();
}
function onEvent2() {
++globalState;
myMethod();
}
function myMethod() {
if (globalState < 2) {
return;
}
// тут главная логика...
}