minimap working

parent a5cdeed8
...@@ -17,10 +17,7 @@ var xyz = new ol.layer.Tile({ ...@@ -17,10 +17,7 @@ var xyz = new ol.layer.Tile({
extent: defaultExtent, extent: defaultExtent,
source: new ol.source.XYZ({ source: new ol.source.XYZ({
projection: 'EPSG:3857', projection: 'EPSG:3857',
// url: './home/emmanuelhp/Documentos/scripts/images/test/{z}/{x}/{-y}.png', url: '/static/reports/test/{z}/{x}/{-y}.png',
// tileUrlFunction: function(tileCoord) {
// return '/home/emmanuelhp/Documentos/scripts/images/test/' + tileCoord[0] + '/' + tileCoord[1] + '/' + tileCoord[2] + '.png';
// },
tilePixelRatio: 2, tilePixelRatio: 2,
minZoom: 7, minZoom: 7,
maxZoom: 14 maxZoom: 14
...@@ -36,73 +33,3 @@ var map = new ol.Map({ ...@@ -36,73 +33,3 @@ var map = new ol.Map({
zoom: 10 zoom: 10
}) })
}); });
// useful urls
// https://gis.stackexchange.com/questions/309115/mismatch-between-openlayers-5-and-xyz-layer-on-some-zoom-levels
// https://gis.stackexchange.com/questions/286649/displaying-tiles-generated-by-gdal2tiles-with-openlayers
// https://github.com/openlayers/openlayers/issues/3707
// function init(){
// // TODO: definir segun imagenes generadas
// var options = {
// div: "minimap",
// controls: [],
// projection: "EPSG:3857",
// displayProjection: new OpenLayers.Projection("EPSG:4326"),
// numZoomLevels: 4
// };
//
// var tmsoverlay = new OpenLayers.Layer.TMS("TMS Overlay", "",
// {
// serviceVersion: '.',
// layername: '.',
// alpha: true,
// type: 'png',
// isBaseLayer: false,
// getURL: getURL
// });
//
// if (OpenLayers.Util.alphaHack() == false) {
// tmsoverlay.setOpacity(0.6);
// }
//
// map.addLayers([mapbox]);
//
// var switcherControl = new OpenLayers.Control.LayerSwitcher();
// map.addControl(switcherControl);
// switcherControl.maximizeControl();
//
// map.zoomToExtent(mapBounds.transform(map.displayProjection, map.projection));
//
// map.addControls([
// new OpenLayers.Control.PanZoomBar(),
// new OpenLayers.Control.Navigation(),
// new OpenLayers.Control.MousePosition(),
// new OpenLayers.Control.ArgParser(),
// new OpenLayers.Control.Attribution()
// ]);
// }
//
//
// function getURL(bounds) {
// bounds = this.adjustBounds(bounds);
// var res = this.getServerResolution();
// var x = Math.round((bounds.left - this.tileOrigin.lon) / (res * this.tileSize.w));
// var y = Math.round((bounds.bottom - this.tileOrigin.lat) / (res * this.tileSize.h));
// var z = this.getServerZoom();
//
// var path = this.serviceVersion + "/" + this.layername + "/" + z + "/" + x + "/" + y + "." + this.type;
// var url = this.url;
// if (OpenLayers.Util.isArray(url)) {
// url = this.selectUrl(path, url);
// }
// if (mapBounds.intersectsBounds(bounds) && (z >= mapMinZoom) && (z <= mapMaxZoom)) {
// return url + path;
// } else {
// return emptyTileURL;
// }
// }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment