<commit_before><!DOCTYPE html>
<html>
<head>
  <title>Convention Map</title>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
  <script src="http://cdn.leafletjs.com/leaflet-0.4.4/leaflet.js"></script>
	<link rel="stylesheet" href="Control.Legende.css" />
	<script src="Control.Legende.js"></script>
  <script src="map.js"></script>
  <script>
    var map, ids = {};
    //var apiUrl = 'http://bastler.bplaced.net/api/inbaz_api.php?callback=?';
    var apiUrl = 'http://www.jugglingedge.com/feeds/createjson.php?Data=events&UserID=404&CallBack=?';

    $(function () {
      map = initMap();
      map.zoomIn();
      loadPoi();
      //maybe in future
      map.on('moveend', loadPoi);
      //load only once for now
      //loadPoi();

		  var info = new L.Control.InbazLegende();

		  map.addControl(info);
    });


    function loadPoi() {
      if (map.getZoom() < 4) {
        return;
      }

      var jongIcon = L.icon({
        iconUrl: 'icons/conTag_1.png',
        iconSize: [32, 32],
        iconAnchor: [-3, -3],
        popupAnchor: [0, 0]
      });
      var uniIcon = L.icon({
        iconUrl: 'icons/oconTag_2.png',
        iconSize: [32, 32],
        iconAnchor: [-3, 35],
        popupAnchor: [0, 0]
      });
      var acroIcon = L.icon({
        iconUrl: 'icons/conTag_3.png',
        iconSize: [32, 32],
        iconAnchor: [3, 3],
        popupAnchor: [0, 0]
      });

        //var poiUrl = 'http://192.168.1.51/inbaz_tests/api.php&bbox=BBOX'.replace(/(BBOX)/g, map.getBounds());//.toOverpassBBoxString());
        //var poiUrl = 'http://192.168.1.51/inbaz_tests/api.php?user=k4';
        //var poiUrl = 'http://overpass-api.de/api/interpreter?data=[out:json];node(BBOX)[amenity=restaurant];out;'.replace(/(BBOX)/g, map.getBounds().toOverpassBBoxString());

        var poiInfo = function(tags) {
          var r = $('<table>');
          for (key in tags)
            r.append($('<tr>').append($('<th>').text(key)).append($('<td>').text(tags[key])));
          return $('<div>').append(r).html();
        }

        function onEachFeature(feature, layer) {
          var popupContent = "<p>I started out as a GeoJSON " +
              feature.geometry.type + ", but now I'm a Leaflet vector!</p>";

          if (feature.properties && feature.properties.popupContent) {
            popupContent += feature.properties.popupContent;
          }

          layer.bindPopup(popupContent);
        }

        $.getJSON(apiUrl, { } , function(data) {
          //TODO check
          for(i=0;i<data.elements.length;i++) {
            console.log(data.elements[i].FullTitle);
          }
//          L.geoJson(data, {
//
//            onEachFeature: onEachFeature,
//
//            pointToLayer: function (feature, latlng) {
//              return L.marker(latlng, {icon: jongIcon});
//  //    				return L.circleMarker(latlng, {
//  //    					radius: 8,
//  //    					fillColor: "#ff7800",
//  //    					color: "#000",
//  //    					weight: 1,
//  //    					opacity: 1,
//  //    					fillOpacity: 0.8
//  //    				});
//            }
//          }).addTo(map);
//
//  //        $.each(data.elements, function(ign, i) {
//  //          if (i.id in ids) return;
//  //          ids[i.id] = true;
//  //          L.marker([i.lat, i.lon], {
//  //            icon: jongIcon,
//  //            title: 'Convention'
//  //          }).addTo(map);
//  //          //}).bindPopup(poiInfo(i.tags)).addTo(map);
//  //        });
        });
    }

  </script><commit_msg>code clean up<commit_after><!DOCTYPE html>
<html>
<head>
  <title>Convention Map</title>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
  <script src="http://cdn.leafletjs.com/leaflet-0.4.4/leaflet.js"></script>
	<link rel="stylesheet" href="Control.Legende.css" />
	<script src="Control.Legende.js"></script>
  <script src="map.js"></script>
  <script>
    var map, ids = {};
    var apiUrl = 'http://www.jugglingedge.com/feeds/createjson.php?CallBack=?';

    $(function () {
      map = initMap();
      //map.zoomIn();
      loadPoi();
      //maybe in future
      //map.on('moveend', loadPoi);
      //load only once for now

		  var info = new L.Control.InbazLegende();

		  map.addControl(info);
    });


    function loadPoi() {
      if (map.getZoom() < 4) {
        return;
      }

      var jongIcon = L.icon({
        iconUrl: 'icons/conTag_1.png',
        iconSize: [32, 32],
        iconAnchor: [-3, -3],
        popupAnchor: [0, 0]
      });
      var uniIcon = L.icon({
        iconUrl: 'icons/oconTag_2.png',
        iconSize: [32, 32],
        iconAnchor: [-3, 35],
        popupAnchor: [0, 0]
      });
      var acroIcon = L.icon({
        iconUrl: 'icons/conTag_3.png',
        iconSize: [32, 32],
        iconAnchor: [3, 3],
        popupAnchor: [0, 0]
      });

        var poiInfo = function(tags) {
          var r = $('<table>');
          for (key in tags)
            r.append($('<tr>').append($('<th>').text(key)).append($('<td>').text(tags[key])));
          return $('<div>').append(r).html();
        }

        $.getJSON(apiUrl, {Data : "events", UserID : "404" } , function(data) {
          //convert Conventions to a POI overlay
          for(i=0;i<data.length;i++) {
            if (data[i].EventID in ids) return;
            ids[data[i].EventID] = true;
            if ((data[i].Lat == 0) && (data[i].Lng == 0)) {
              console.log(data[i].ShortTitle + " has no position");
              continue;
            }
            var pos = new L.LatLng(data[i].Lat, data[i].Lng);
            var icon = jongIcon;
            var popup = poiInfo(data[i]);
            var marker = new L.Marker(pos, {icon: icon}).bindPopup(popup);
            map.addLayer(marker);
          }
        });
    }

  </script>
{'fraction_non_alphanumeric': 0.1953542780748663, 'fraction_numerical': 0.018549465240641713, 'mean_word_length': 1.9424778761061947, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, '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': '3888314', 'n_tokens_mistral': 2185, 'n_tokens_neox': 2054, 'n_words': 362}