Ich bastel wieder an einer Erweiterung für unsere Conan Zocker.
Naja, jedenfalls bekomme ich in meiner Firefox Konsole eine Ausgabe wo ich denke, dass diese mit meinem Problem zusammen hängt und mir da evtl. ein Entwickler mehr zu sagen kann.
Um folgende Zeile geht es:
Dafür eine kurze erklärung was ich gerade mache:
Ich benutze die Google Maps API um eine Map aus einem Game (hier gerade Conan Exiles) interaktiv darzustellen. Dafür habe ich mit "GMap Image Cutter" meine Map in Tiles zerlegt im Format .png.
Die Bilder werden laut Konsole auch gefunden (pro Zoomstufe immer 9 tiles).
So, ich bekomme also immer 9x (dateinamen sind natürlich 9x unterschiedlich für die 9 verschiedenen tiles pto zoom)
aber gleich danach folgt auch 9x
Hier mal meine /views/index/index.php (Wie gesagt sehr anfängliche Version ^^)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | <script> //<![CDATA[ var centreLat=0.0; var centreLon=0.0; var initialZoom=3; var imageWraps=false; //SET THIS TO false TO PREVENT THE IMAGE WRAPPING AROUND var map; //the GMap3 itself var gmicMapType; function GMICMapType() { this.Cache = Array(); this.opacity = 1.0; } GMICMapType.prototype.tileSize = new google.maps.Size(256, 256); GMICMapType.prototype.maxZoom = 19; GMICMapType.prototype.getTile = function (coord, zoom, ownerDocument) { var c = Math.pow(2, zoom); var c = Math.pow(2, zoom); var tilex=coord.x,tiley=coord.y; if (imageWraps) { if (tilex<0) tilex=c+tilex%c; if (tilex>=c) tilex=tilex%c; if (tiley<0) tiley=c+tiley%c; if (tiley>=c) tiley=tiley%c; } else { if ((tilex<0)||(tilex>=c)||(tiley<0)||(tiley>=c)) { var blank = ownerDocument.createElement( 'DIV' ); blank.style.width = this.tileSize.width + 'px' ; blank.style.height = this.tileSize.height + 'px' ; return blank; } } var img = ownerDocument.createElement( 'IMG' ); var d = tilex; var e = tiley; var f = "t" ; for ( var g = 0; g < zoom; g++) { c /= 2; if (e < c) { if (d < c) { f += "q" } else { f += "r" ; d -= c } } else { if (d < c) { f += "t" ; e -= c } else { f += "s" ; d -= c; e -= c } } } img.id = "t_" + f; img.style.width = this.tileSize.width + 'px' ; img.style.height = this.tileSize.height + 'px' ; img.src = "../../static/map-tiles/" +f+ ".jpg" ; this.Cache.push(img); return img; } GMICMapType.prototype.realeaseTile = function (tile) { var idx = this.Cache.indexOf(tile); if (idx!=-1) this.Cache.splice(idx, 1); tile=null; } GMICMapType.prototype.name = "Map" ; GMICMapType.prototype.alt = "Map" ; GMICMapType.prototype.setOpacity = function (newOpacity) { this.opacity = newOpacity; for ( var i = 0; i < this.Cache.length; i++) { this.Cache[i].style.opacity = newOpacity; //mozilla this.Cache[i].style.filter = "alpha(opacity=" + newOpacity * 100 + ")" ; //ie } } function getWindowHeight() { if (window.self&&self.innerHeight) { return self.innerHeight; } if (document.documentElement&&document.documentElement.clientHeight) { return document.documentElement.clientHeight; } return 0; } function resizeMapDiv() { var d=document.getElementById( "map_canvas" ); var offsetTop=0; for ( var elem=d; elem!=null; elem=elem.offsetParent) { offsetTop+=elem.offsetTop; } var height=getWindowHeight()-offsetTop-16; if (height>=0) { d.style.height=height+ "px" ; } } function load() { resizeMapDiv(); var latlng = new google.maps.LatLng(centreLat, centreLon); var myOptions = { zoom: initialZoom, minZoom: 3, maxZoom: 6, center: latlng, panControl: true, zoomControl: true, mapTypeControl: true, scaleControl: false, streetViewControl: false, gestureHandling: 'greedy' , overviewMapControl: true, mapTypeControlOptions: { mapTypeIds: [ "Map" ] }, mapTypeId: "Map" } map = new google.maps.Map(document.getElementById( "map_canvas" ), myOptions); gmicMapType = new GMICMapType(); map.mapTypes.set( "Map" ,gmicMapType); ///////////////////////////////////////////////////////////////////////////////////// //Add any markers here e.g. // var marker = new google.maps.Marker({ // map:map, // position: new google.maps.LatLng(x,y), // title: "My Marker" // }); ///////////////////////////////////////////////////////////////////////////////////// // google.maps.event.addListener(map, "rightclick", function(event) { // var lat = event.latLng.lat(); // var lng = event.latLng.lng(); // populate yor box/field with lat, lng // var marker = new google.maps.Marker({ // map:map, // position: new google.maps.LatLng(lat,lng), // title: "Home" // }); //}); /** * Create the menu and attached it to the map */ // var menu = new contextMenu({map:map}); // Add some items to the menu // menu.addItem('input', 'bezeichnung', function(map, latLng){ // }); // menu.addSep(); // menu.addItem('Marker setzen', function(map, latLng){ // var marker = new google.maps.Marker({ // map:map, // position: new google.maps.LatLng(latLng.lat(),latLng.lng()), // title: document.getElementById('bezeichnung').value // }); // }); } </script> <style> #map_canvas { overflow:visible; } </style> <body> <div id= "map_canvas" style= "width: 500px;height: 500px;" ></div> <script>document.getElementsByTagName( 'body' )[0].onload = load(); document.getElementsByTagName( 'body' )[0].oneresize= resizeMapDiv()</script> </body> |
Danke erstmal. MFG Raptus
verwendete ilch Version: 2.x
Zuletzt modifiziert von Raptusguru am 26.09.2017 - 20:34:08