Commit 23154732775024712562528b6dc8017ee1c7e239
1 parent
458d1265
Exists in
master
and in
7 other branches
--no commit message
Showing
1 changed file
with
26 additions
and
11 deletions
Show diff stats
interface/osmdebug.htm
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> |
| 6 | 6 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 7 | 7 | <title>i3GEO - OpenLayers+OSM</title> |
| 8 | -<script src="../classesjs/i3geonaocompacto.js"></script> | |
| 8 | +<script type="text/javascript" src="../classesjs/i3geonaocompacto.js"></script> | |
| 9 | 9 | <script src="../pacotes/openlayers/OpenLayers2131.js.php"></script> |
| 10 | 10 | <link rel="stylesheet" type="text/css" href="../css/black.css"> |
| 11 | 11 | <style> |
| ... | ... | @@ -175,18 +175,22 @@ |
| 175 | 175 | OpenLayers.ImgPath = "../pacotes/openlayers/img/"; |
| 176 | 176 | (function() { |
| 177 | 177 | function getTileURL(bounds) { |
| 178 | - var res = i3geoOL.getResolution(); | |
| 179 | - //console.info(bounds) | |
| 180 | - var x = Math.round((bounds.left - i3geoOL.maxExtent.left) / (res * 256)); | |
| 181 | - var y = Math.round((i3geoOL.maxExtent.top - bounds.top) / (res * 256)); | |
| 182 | - var z = i3geoOL.getZoom(); | |
| 183 | - //var limit = Math.pow(2, z); | |
| 178 | + console.info(this) | |
| 179 | + var res = this.map.getResolution(); | |
| 180 | + //var m = i3GEO.util.projGeo2OSM(i3geoOL.maxExtent); | |
| 181 | + //bounds = i3GEO.util.projGeo2OSM(bounds) | |
| 182 | + //this.map.zoomIn() | |
| 183 | + var m = (this.maxExtent); | |
| 184 | + var x = Math.round((bounds.left - m.left) / (res * 256)); | |
| 185 | + var y = Math.round((m.top - bounds.top) / (res * 256)); | |
| 186 | + var z = this.map.getZoom(); | |
| 187 | + var limit = Math.pow(2, z); | |
| 184 | 188 | |
| 185 | 189 | //if (y < 0 || y >= limit) { |
| 186 | 190 | // return OpenLayers.Util.getImagesLocation() + "404.png"; |
| 187 | 191 | //} else { |
| 188 | 192 | x = ((x % limit) + limit) % limit; |
| 189 | - return this.url + "x=" + x + "&y=" + y + "&z=" + z; //+ "&ss=" + x + "-" + y + "-" + z | |
| 193 | + return this.url + "x=" + x + "&y=" + y + "&z=" + (z); //+ "&ss=" + x + "-" + y + "-" + z | |
| 190 | 194 | //} |
| 191 | 195 | } |
| 192 | 196 | |
| ... | ... | @@ -226,6 +230,18 @@ |
| 226 | 230 | attribution: attribOSMData |
| 227 | 231 | }); |
| 228 | 232 | |
| 233 | + var arrayMapQuestAerial = ["http://oatile1.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.jpg", | |
| 234 | + "http://oatile2.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.jpg", | |
| 235 | + "http://oatile3.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.jpg", | |
| 236 | + "http://oatile4.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.jpg" | |
| 237 | + ]; | |
| 238 | + | |
| 239 | + var layMapQuestAerial = new OpenLayers.Layer.OSM("MapQuest Open Aerial", arrayMapQuestAerial,{ | |
| 240 | + displayOutsideMaxExtent: true, | |
| 241 | + attribution: attribMapQuestAerial, | |
| 242 | + isBaseLayer : true, | |
| 243 | + visibility : false | |
| 244 | + }); | |
| 229 | 245 | |
| 230 | 246 | var layMSNOsmRoad = new OpenLayers.Layer.TMS("OSM Roads", "http://korona.geog.uni-heidelberg.de/tiles/roads/", { |
| 231 | 247 | type : 'png', |
| ... | ... | @@ -233,8 +249,7 @@ |
| 233 | 249 | isBaseLayer : true, |
| 234 | 250 | visibility : false, |
| 235 | 251 | attribution : mapSurfer, |
| 236 | - numZoomLevels: 20 | |
| 237 | - //tileOrigin: new OpenLayers.LonLat(0,0) | |
| 252 | + displayOutsideMaxExtent: true | |
| 238 | 253 | }); |
| 239 | 254 | |
| 240 | 255 | var layMSNOsmRoadsGray = |
| ... | ... | @@ -289,7 +304,7 @@ |
| 289 | 304 | }); |
| 290 | 305 | |
| 291 | 306 | i3GEO.Interface.openlayers.LAYERSADICIONAIS = [ |
| 292 | - osm, aquarela, toner, tonerlite, layMSNOsmRoad,layMSNOsmRoadsGray,layMSNOsmBoundariesOverlay,layMSNOsmHybrid,layMSNAsterHillshade,layMSNAsterContours | |
| 307 | + osm, aquarela, toner, tonerlite, layMapQuestAerial, layMSNOsmRoad,layMSNOsmRoadsGray,layMSNOsmBoundariesOverlay,layMSNOsmHybrid,layMSNAsterHillshade,layMSNAsterContours | |
| 293 | 308 | ]; |
| 294 | 309 | })(); |
| 295 | 310 | i3GEO.Interface.openlayers.googleLike = true; | ... | ... |