2011-07-07 29 views
0

情報ウィンドウにはデスクトップ上でokと表示され、コンテンツを表示するように警告を設定すると正しいhtmlコードが表示されます。しかし、iPhone上では空白の情報ウィンドウ(その中にテキストなし)が表示されます。ここでiPhoneが空白の情報ウィンドウを表示しています

は私のコードです:

function showPOICategory(category) { 
     // Icons { ID, Image } 
     // Entry { Latitude, Longitude, Name, Description, iconID); 
     $.getJSON('ajax/poi.php?key=' + jQGMSettings.apiKey + '&c=' + category , function(data) { 
      $.each(data.poi, function(key, val) { 
       // Set current position marker 
       var $image = new google.maps.MarkerImage('/images/pois/'+data.icons[val.image], 
        // This marker is 20 pixels wide by 32 pixels tall. 
        new google.maps.Size(32, 37), 
        // The origin for this image is 0,0. 
        new google.maps.Point(0,0), 
        // The anchor for this image is the base of the flagpole at 0,32. 
        new google.maps.Point(16, 37) 
       ); 

       var $marker = new google.maps.Marker({ 
        title: val.title, 
        icon: $image, 
        clickable: true, 
        draggable: false, 
        position: new google.maps.LatLng(val.latitude, val.longitude), 
        animation: google.maps.Animation.DROP, 
        map: map 
       }); 

       // Info Window 
       if(val.info == null) { 
        var $infowindow = new google.maps.InfoWindow({ 
         content: '<div><h1>' + val.title + '</h1>Prueba</div>' 
        }); 
       } else { 
        var $infowindow = new google.maps.InfoWindow({ 
         content: '<div style="color:#000000;"><h1 style="font-size:14px; font-family:Helvetica; padding:0px; margin:0px;">' + val.title + '</h1>' + val.info + 'Prueba</div>', 
         maxWidth: 200 
        }); 
       } 

       var $listener = google.maps.event.addListener($marker, 'click', function() { 
        if(infoWindow != null) { 
         infoWindow.close(); 
        } 

        infoWindow = $infowindow; 
        infoWindow.open(map,$marker); 
       }); 

       // Keep track of the marker to remove it ;) 
       pois.push({ 
        marker: $marker, 
        listener: $listener 
       }); 



      }); 

     }); 
    } 

誰もが前に、この問題を持っていましたか?私はどこに問題があるのか​​を知るためにナッツに行くつもりです。

+0

私は同じ問題を抱えています。私はそれをiphoneのSafariでうまく読み込むことができたので、UIWebviewの設定であることを推測しています。何を変更するのか分かりません。 – MikeIsrael

答えて

0

私は結局問題を解決することができましたが、それが役立つかどうかはわかりません。 loadHTMLStringメソッドを使用していますか?その場合、baseURLを宣言していないと、呼び出しで宣言しようとします。

baseURL:[NSURL URLWithString:@"/"] 
関連する問題