ilch Forum » Ilch CMS 2.X » Fehlersuche und Probleme » [ERLEDIGT] index.php/error...

Geschlossen
  1. #1
    User Pic
    Raptusguru Mitglied
    Registriert seit
    10.02.2010
    Beiträge
    148
    Beitragswertungen
    11 Beitragspunkte
    Hi, ich bins mal wieder.
    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:
    GET 
    http://localhost/ilch/index.php/error/index/index/error/Module/errorText/static


    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)
    GET 
    http://localhost/ilch/index.php/static/map-tiles/tqsssrt.jpg


    aber gleich danach folgt auch 9x
    GET 
    http://localhost/ilch/index.php/error/index/index/error/Module/errorText/static


    Hier mal meine /views/index/index.php (Wie gesagt sehr anfängliche Version ^^)
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
    <script type="text/javascript" src="https://maps.google.com/maps/api/js?key=********"></script>
    <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
    0 Mitglieder finden den Beitrag gut.
  2. #2
    User Pic
    Raptusguru Mitglied
    Registriert seit
    10.02.2010
    Beiträge
    148
    Beitragswertungen
    11 Beitragspunkte
    OK, ich hab den fehler gefunden. Wie immer mal wieder nich richtig hingeglotzt ^^.

    Die Zeile:
    GET 
    http://localhost/ilch/index.php/static/map-tiles/tqsssrt.jpg


    sagt ja ganz klar aus, dass der Pfad zu meinen Bildern nich hin haut.
    Gelöst hab ich das nun im js mit:

    img.src = "<?=$this->getModuleUrl('static/map-tiles') ?>/"+f+".jpg";


    Naja meine Map wird zwar immernoch grau angezeigt, aber das scheint irgend nen anderer kleiner fehler zu sein. Falls jemand nen Hinweis für mich hat, dann immer her damit ^^.

    Danköö
    MFG Raptus
    0 Mitglieder finden den Beitrag gut.
Geschlossen

Zurück zu Fehlersuche und Probleme

Optionen: Bei einer Antwort zu diesem Thema eine eMail erhalten