0

ベクター レイヤーにスタイル属性を指定すると、Firefoxはそのレイヤーのベクターをレンダリングしません。

これをテストするには、含まれている javascript と html ページを実行するだけです。

右上隅に EditingToolbar が表示されます。Firefox を使用して LineString を描画してみてください。

レイヤーに LineString がまったく表示されないことがわかります。

ベクターレイヤーから styleMap 属性を削除してみてください。すべてが正しく機能します。

この問題の原因をご存知でしたら、お知らせください。

お時間をいただきありがとうございます。

PS

また、独自の OpenLayers ライブラリを使用して、html ページからリンクする必要があります。

他のバージョンには別の厄介なバグがあるため、個人的には GitHub の最新バージョンを使用しています。

グーグルマップからのダイアログが絶えずポップアップしています。

function initialize(){
    new Map();
}

function Map(){
    this.map;
    this.editing_toolbar;
    this.vectors;
    this.epsg900913 = new OpenLayers.Projection('EPSG:900913');
    this.epsg4326 = new OpenLayers.Projection('EPSG:4326');
    this.line_control;
    this.renderer;
    this.line_control,this.renderer=OpenLayers.Util.getParameters(window.location.href).renderer;
    this.renderer= (this.renderer) ? [this.renderer] : OpenLayers.Layer.Vector.prototype.renderers;
    // Create the map object
    this.map = new OpenLayers.Map('map');
    //Create a Google layer
    var gmap = new OpenLayers.Layer.Google(
         "Google Streets", // the default
        {
            numZoomLevels: 30,
            projection: new OpenLayers.Projection("EPSG:900913")
        }
    );

    var my_style=new OpenLayers.StyleMap({
        "default":new OpenLayers.Style({
            strokeWidth:5,
            fillColor:"1484e6",
            strokeColor:"1484e6"
        }),
        "select":new OpenLayers.Style({
            fillColor:"e39119",
            strokeColor:"e39119"
        })
    });
    this.vectors= new OpenLayers.Layer.Vector(
        "Vector Layer",
        {styleMap:my_style,
            renderers:this.renderer
        }
    );



    this.map.addLayers([gmap,this.vectors]);
    this.editing_toolbar=new OpenLayers.Control.EditingToolbar(this.vectors);
    this.map.addControl(this.editing_toolbar);



    this.map.addControl(new OpenLayers.Control.LayerSwitcher());
    this.map.addControl(new OpenLayers.Control.MousePosition());


    this.map.setCenter(new OpenLayers.LonLat(-123.12, 49.28).transform(this.epsg4326, this.epsg900913), 13);         

}



<html>
    <head>
        <title>OpenLayers: Google Layer Example</title>
        <script type="text/javascript" src="http://maps.google.com/maps/api/js?key=AIzaSyAt66skA87gnWvy7UQl065zFaFHNXJiBc4&sensor=false"></script>
        <script type="text/javascript" src="/static/open_layers/lib/OpenLayers.js"></script>
        <script type="text/javascript" src="/static/firefox_bug.js"></script>
    </head>

    <body onload="initialize()">
        <div id="map"   class="smallmap"></div>
    </body>

</html>
4

0 に答える 0