Skip to main content
corrected spelling/grammar
Source Link
nmtoken
  • 13.6k
  • 5
  • 38
  • 89

I've godgot an OpenLayerOpenLayers web application with a custom XYZ layer which downloads tiles from the server itself:

OpenLayers.Layer.MOBAC_OSMDROID_ZIP = OpenLayers.Class(
          OpenLayers.Layer.XYZ, {
              name: "tiles base",
              transitionEffect: "resize",
              sphericalMercator: true,
              url: '../map/${z}/${x}/${y}.png',
              [...]
          });

The funny thing here is that I can use MOBAC to download selected parts of OpenStreetMap and serve them from my website. So far, so good.

The problem is: obviously I do not want to download the whole world from OpenStreetMap, but only, for example, zoom levels 0 &and 1 for the world, 2-4 for Europe, 5-7 for Spain and so on. Then, when I am zommingzooming in to Spain I get the right tiles. But if I move outside Spain, I just get the damn pink "no-tile" image. I can easily remove such no-image with the .olImageLoadError CSS class... but it still does not show a map.

What I would like is: if there is no tile, use the previous tile, scaled. This way you will probably have an overview of where you are when there are no specific tiles for such level.

Any idea? Is something like this included in OpenLayers? Any idea to implementeimplement it myself?

Since the "resize" effect does not remove the old tiles for a while, maybe keeping them "forever" would work...

I've god an OpenLayer web with a custom XYZ layer which downloads tiles from the server itself:

OpenLayers.Layer.MOBAC_OSMDROID_ZIP = OpenLayers.Class(
          OpenLayers.Layer.XYZ, {
              name: "tiles base",
              transitionEffect: "resize",
              sphericalMercator: true,
              url: '../map/${z}/${x}/${y}.png',
              [...]
          });

The funny thing here is that I can use MOBAC to download selected parts of OpenStreetMap and serve them from my website. So far, so good.

The problem is: obviously I do not want to download the whole world from OpenStreetMap, but only, for example, zoom levels 0 & 1 for the world, 2-4 for Europe, 5-7 for Spain and so on. Then, when I am zomming in to Spain I get the right tiles. But if I move outside Spain, I just get the damn pink "no-tile" image. I can easily remove such no-image with the .olImageLoadError CSS class... but it still does not show a map.

What I would like is: if there is no tile, use the previous tile, scaled. This way you will probably have an overview of where you are when there are no specific tiles for such level.

Any idea? Is something like this included in OpenLayers? Any idea to implemente it myself?

Since the "resize" effect does not remove the old tiles for a while, maybe keeping them "forever" would work...

I've got an OpenLayers web application with a custom XYZ layer which downloads tiles from the server itself:

OpenLayers.Layer.MOBAC_OSMDROID_ZIP = OpenLayers.Class(
          OpenLayers.Layer.XYZ, {
              name: "tiles base",
              transitionEffect: "resize",
              sphericalMercator: true,
              url: '../map/${z}/${x}/${y}.png',
              [...]
          });

The funny thing here is that I can use MOBAC to download selected parts of OpenStreetMap and serve them from my website. So far, so good.

The problem is: obviously I do not want to download the whole world from OpenStreetMap, but only, for example, zoom levels 0 and 1 for the world, 2-4 for Europe, 5-7 for Spain and so on. Then, when I am zooming in to Spain I get the right tiles. But if I move outside Spain, I just get the damn pink "no-tile" image. I can easily remove such no-image with the .olImageLoadError CSS class... but it still does not show a map.

What I would like is: if there is no tile, use the previous tile, scaled. This way you will probably have an overview of where you are when there are no specific tiles for such level.

Any idea? Is something like this included in OpenLayers? Any idea to implement it myself?

Since the "resize" effect does not remove the old tiles for a while, maybe keeping them "forever" would work...

added 2 characters in body
Source Link

I've god an OpenLayer web with a custom XYZ layer which downloads tiles from the server itself:

OpenLayers.Layer.MOBAC_OSMDROID_ZIP = OpenLayers.Class(
          OpenLayers.Layer.XYZ, {
              name: "tiles base",
              transitionEffect: "resize",
              sphericalMercator: true,
              url: '../map/${z}/${x}/${y}.png',
              [...]
          });

The funny thing here is that I can use MOBAC to download selected parts of OpenStreetMap and serve them from my website. So far, so good.

The problem is: obviously I do not want to download the whole world from OpenStreetMap, but only, for example, zoom levels 0 & 1 for the world, 2-4 for Europe, 5-7 for Spain and so on. Then, when I am zomming in to Spain I get the right tiles. But if I move outside Spain, I just get the damn pink "no-tile" image. I can easily remove such no-image with the .olImageLoadError CSS class... but it still does not show a map.

What I would like is: if there is no tile, use the previous tile, scaled. This way you will probably have an overview of where you are when there are no specific tiles for such level.

IAny idea? Is something like this included in OpenLayers? Any idea to implemente it myself?

Since the "resize" effect does not remove the old tiles for a while, maybe keeping them "forever" would work...

I've god an OpenLayer web with a custom XYZ layer which downloads tiles from the server itself:

OpenLayers.Layer.MOBAC_OSMDROID_ZIP = OpenLayers.Class(
          OpenLayers.Layer.XYZ, {
              name: "tiles base",
              transitionEffect: "resize",
              sphericalMercator: true,
              url: '../map/${z}/${x}/${y}.png',
              [...]
          });

The funny thing here is that I can use MOBAC to download selected parts of OpenStreetMap and serve them from my website. So far, so good.

The problem is: obviously I do not want to download the whole world from OpenStreetMap, but only, for example, zoom levels 0 & 1 for the world, 2-4 for Europe, 5-7 for Spain and so on. Then, when I am zomming in to Spain I get the right tiles. But if I move outside Spain, I just get the damn pink "no-tile" image. I can easily remove such no-image with the .olImageLoadError CSS class... but it still does not show a map.

What I would like is: if there is no tile, use the previous tile, scaled. This way you will probably have an overview of where you are when there are no specific tiles for such level.

I idea? Is something like this included in OpenLayers? Any idea to implemente it myself?

Since the "resize" effect does not remove the old tiles for a while, maybe keeping them "forever" would work...

I've god an OpenLayer web with a custom XYZ layer which downloads tiles from the server itself:

OpenLayers.Layer.MOBAC_OSMDROID_ZIP = OpenLayers.Class(
          OpenLayers.Layer.XYZ, {
              name: "tiles base",
              transitionEffect: "resize",
              sphericalMercator: true,
              url: '../map/${z}/${x}/${y}.png',
              [...]
          });

The funny thing here is that I can use MOBAC to download selected parts of OpenStreetMap and serve them from my website. So far, so good.

The problem is: obviously I do not want to download the whole world from OpenStreetMap, but only, for example, zoom levels 0 & 1 for the world, 2-4 for Europe, 5-7 for Spain and so on. Then, when I am zomming in to Spain I get the right tiles. But if I move outside Spain, I just get the damn pink "no-tile" image. I can easily remove such no-image with the .olImageLoadError CSS class... but it still does not show a map.

What I would like is: if there is no tile, use the previous tile, scaled. This way you will probably have an overview of where you are when there are no specific tiles for such level.

Any idea? Is something like this included in OpenLayers? Any idea to implemente it myself?

Since the "resize" effect does not remove the old tiles for a while, maybe keeping them "forever" would work...

Source Link

OpenLayers.Layer.XYZ keep previous tile if zoom with no tile

I've god an OpenLayer web with a custom XYZ layer which downloads tiles from the server itself:

OpenLayers.Layer.MOBAC_OSMDROID_ZIP = OpenLayers.Class(
          OpenLayers.Layer.XYZ, {
              name: "tiles base",
              transitionEffect: "resize",
              sphericalMercator: true,
              url: '../map/${z}/${x}/${y}.png',
              [...]
          });

The funny thing here is that I can use MOBAC to download selected parts of OpenStreetMap and serve them from my website. So far, so good.

The problem is: obviously I do not want to download the whole world from OpenStreetMap, but only, for example, zoom levels 0 & 1 for the world, 2-4 for Europe, 5-7 for Spain and so on. Then, when I am zomming in to Spain I get the right tiles. But if I move outside Spain, I just get the damn pink "no-tile" image. I can easily remove such no-image with the .olImageLoadError CSS class... but it still does not show a map.

What I would like is: if there is no tile, use the previous tile, scaled. This way you will probably have an overview of where you are when there are no specific tiles for such level.

I idea? Is something like this included in OpenLayers? Any idea to implemente it myself?

Since the "resize" effect does not remove the old tiles for a while, maybe keeping them "forever" would work...