function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
nabemarunabemaru 

VisualFoceに埋め込んだGoogleMapのIE8表示不具合

nabemaruです。

 

掲題の件、VisualFoceに埋め込んだGoogleMap(API V3)をChrome等で閲覧すると問題なく地図が表示されるのですが、

IE8で閲覧すると「googleが宣言されていません」とエラーが表示され、地図が表示されません。

 

VisualForceの問題なのか?

Google Map APIを利用するJavaScriptの問題なのか?

IE8の問題なのか?

きり分けができてないのですが、どなたか対応方法をご存知でしたら、

何卒ご教示のほど、お願いいたします。

 

以下がテスト用のサンプルVisualForceコードです。

IE8で表示すると、以下のコードの赤文字の【google】が宣言されてないとの事・・・

 

<apex:page >
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"><head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
  var map = null;

  function initialize() {
    var lat = 35.681382;
    var lng = 139.766084;
    var latlng = new google.maps.LatLng(lat, lng);
		
    var myOptions = {
      zoom: 17,
      center: latlng,
      scaleControl: true,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };

    map = new google.maps.Map(document.getElementById('map_canvas'), myOptions);
  }

  if (window.attachEvent) {
    window.attachEvent('onload', initialize);
  } else {
    window.onload = function() { initialize(); };
  }
</script>
</head>
<body onload="initialize()">
  <div id="map_canvas" style="width:600px; height:600px;"></div>
</body>
</html>
</apex:page>

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
nabemarunabemaru

自己解決したので自己フォローです。

 

USサイトでの質問

 

において、IE8のセキュリティ設定の問題ではとコメント頂きました。

 

たしかに、IE7→IE8で、デフォルトのセキュリティ設定が、

中→中高に変わっていた点が問題でしたので、それを変更し対応すると地図が表示されました。

 

また、セールスフォースからは、HTTPSでアクセスしており、

そのページの中にHTTPでアクセスするコンテンツがある場合、

セキュリティ設定によっては、信頼されたHTTPSコンテンツのみ表示しますか?

と確認ダイアログが出るのですが、そこで「はい」と選んでいた事が問題でした。

 

以上情報共有まで。