WebGIS点要素渲染性能测试

$('#stationQuery').bind('click', function(){
    var drawStyle = $.extend( { },  map.geomap( "option", "drawStyle" ));
    var graphicLayer = $("#graphicLayer");
    var len = 10000;
    var maxX = 107.91953;
    var minX = 106.74598;
    var maxY = 30.168522;
    var minY = 29.14773;
    for(var i=0; i<len; i++)
    {
        var lgtd = Math.random()*(maxX - minX) + minX;
        var lttd = Math.random()*(maxY - minY) + minY;
        //var projectedCoords = $.geo.proj.fromGeodetic( [lgtd, lttd] );
        var projectedCoords = GLtoXY(lgtd, lttd)
        var geo = { "type": "Point", "coordinates": projectedCoords}    
        graphicLayer.geomap( "append", geo, drawStyle, false );
        
    }
    graphicLayer.geomap( "refresh", true );
    /*
    var featureCollection = {'type':'FeatureCollection', 'features':[]};
    var features = featureCollection.features;
    for(var i=0; i<len; i++)
    {
        var lgtd = Math.random()*(maxX - minX) + minX;
        var lttd = Math.random()*(maxY - minY) + minY;
        var projectedCoords = GLtoXY(lgtd, lttd)
        var feature = { "type": "Feature",
          "geometry": {"type": "Point", "coordinates": projectedCoords},
          "properties": {"prop": i}
          };
        features.push(feature);
    }
    var geo = { "type": "Point", "coordinates": projectedCoords}    
    graphicLayer.geomap( "append", featureCollection, drawStyle );
    */
});
posted @ 2016-09-14 13:38  ParamousGIS  阅读(383)  评论(0编辑  收藏  举报