<commit_before><html>
<head>
  <script src="../lib/OpenLayers.js"></script>
  <script type="text/javascript"><!--
    var marker; 
    
    function test_01_Marker_constructor (t) {
        t.plan( 4 );
        var ll = new OpenLayers.LonLat(2,1);
        marker = new OpenLayers.Marker(ll,new OpenLayers.Icon());
        t.ok( marker instanceof OpenLayers.Marker, "new OpenLayers.Marker returns Marker object" );
        t.ok( marker.icon instanceof OpenLayers.Icon, "new marker.Icon returns Icon object" );
        t.ok( marker.lonlat instanceof OpenLayers.LonLat, "new marker.lonlat returns LonLat object" );
        t.ok( marker.lonlat.equals(ll), "marker.lonlat returns correct" );
    }


  // -->
  </script>
</head>
<body>
</body>
</html><commit_msg>add test for marker.onScreen()<commit_after><html>
<head>
  <script src="../lib/OpenLayers.js"></script>
  <script type="text/javascript"><!--
    var marker; 
    
    function test_01_Marker_constructor (t) {
        t.plan( 4 );
        var ll = new OpenLayers.LonLat(2,1);
        marker = new OpenLayers.Marker(ll,new OpenLayers.Icon());
        t.ok( marker instanceof OpenLayers.Marker, "new OpenLayers.Marker returns Marker object" );
        t.ok( marker.icon instanceof OpenLayers.Icon, "new marker.Icon returns Icon object" );
        t.ok( marker.lonlat instanceof OpenLayers.LonLat, "new marker.lonlat returns LonLat object" );
        t.ok( marker.lonlat.equals(ll), "marker.lonlat returns correct" );
    }

    function test_02_Marker_onScreen(t) {
        t.plan( 2 );

        var map = new OpenLayers.Map("map");

        var url = "http://octo.metacarta.com/cgi-bin/mapserv";
        layer = new OpenLayers.Layer.WMS(name, url);

        map.addLayer(layer);
        
        mlayer = new OpenLayers.Layer.Markers('Test Layer');
        map.addLayer(mlayer);
               
        map.zoomToExtent(new OpenLayers.Bounds(-50,-50,50,50));

        //onscreen marker
        var ll = new OpenLayers.LonLat(0,0);
        var marker = new OpenLayers.Marker(ll);
        mlayer.addMarker(marker);
        
        t.ok( marker.onScreen(), "marker knows it's onscreen" );

        //offscreen marker
        var ll = new OpenLayers.LonLat(100,100);
        var marker2 = new OpenLayers.Marker(ll);
        mlayer.addMarker(marker2);

        t.ok( !marker2.onScreen(), "marker knows it's offscreen" );
        
    }


  // -->
  </script>
</head>
<body>
    <div id="map" style="width:500px;height:550px"></div>
</body>
</html>
{'fraction_non_alphanumeric': 0.14554178328668532, 'fraction_numerical': 0.015193922431027589, 'mean_word_length': 2.605187319884726, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3063572', 'n_tokens_mistral': 870, 'n_tokens_neox': 807, 'n_words': 178}