How to program Somfy „Situo 1 io Pure” remote for electric blinds

The recommended procedure starts with pushing simultaneously the Up and Down buttons. I recommend to start with a full reset procedure.

The problem I was having was that pushing at the same time the Up and Down buttons would jog the blind and then, after about 2 seconds it would jog again on it’s own. Continuă lectura „How to program Somfy „Situo 1 io Pure” remote for electric blinds”

Cheap noise-suppression headphones – DIY

Here is how I’ve made some simple but effective noise-suppression headphones.You need a pair of old headphones and a pair of hearing protection earmuffs. My earmuffs were really cheap, 4€, so this will be very cheap noise-suppression headphones. Continuă lectura „Cheap noise-suppression headphones – DIY”

Compare OSM and Google Maps

Why settle with only one online map provider when you can use them all. Sometimes OSM (OpenStreetMaps) offers better coverage in some places while Google Maps look really good plus you have Street View and Satellite View.

That’s why I decided to use a tool that will let you easily compare the maps and get all the available information. It looks something like Continuă lectura „Compare OSM and Google Maps”

Compute OpenStreetMaps tile numbers so that they wrap around

I use Google Maps API to display OSM tiles. Log story short, the code below helps you make this:

be displayed like this:

Notice how the one OSM tile that shows the whole map is replicated left and right forever. In this way the tiles will be shown the same way like Google tiles.

The code to initialize the Google Maps API with OSM tiles:

function init_osm() {
    map_osm = new google.maps.Map(map_div, {
    center: new google.maps.LatLng(pos.lat, pos.lng),
    zoom: pos.zoom,
    mapTypeId: "OSM",
    mapTypeControl: false,
    streetViewControl: false
  });
  //Define OSM map type pointing at the OpenStreetMap tile server
  map_osm.mapTypes.set("OSM", new google.maps.ImageMapType({
    getTileUrl: function(coord, zoom) {
      var maxTile = Math.pow(2, zoom);
      if (coord.y < 0 || coord.y >= maxTile) { return;};
      var x = coord.x % maxTile;
      var y = coord.y % maxTile;
      x = x < 0 ? x + maxTile : x;
      y = y < 0 ? y + maxTile : y;
      return "http://tile.openstreetmap.org/" + zoom + "/" 
                + coord.x + "/" + coord.y + ".png";
    },
    tileSize: new google.maps.Size(256, 256),
    name: "OpenStreetMap",
    maxZoom: 19
  }));
};

Bing Maps API v7 – unable to register/trigger „mousedown” event on map’s div

Instead of:

map.addEventListener("mousedown", handler_function, false);

do:

map.addEventListener("mousedown", handler_function, true);

Notice the „true” value in the second line of code. That means that we get the event during the capture phase. It seems that Bing Maps get the event in the same phase and then kill it, so you will not receive the event if you wait for it in the bubbling phase (like in the first line of code).