<commit_before>'use strict';
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


angular.module('gpxViewer').controller('osmDirCtrl', ['$scope', 'gpxParser',
	function($scope, gpxParser) {
		var log = log4javascript.getLogger("gpxViewer.directives.osmDirCtrl");
		log.debug('creating directive controller: osmDirCtrl');

		// default map position
		var defaultLat = 47.2333;
		var defaultLon = 13.1570;
		var defaultZoom = 11;

		// time for scope change
		var asyncExecTimeChanged = 50;

		// time for osm to focus map (gpx files must be loaded)
		var asyncExecTimeFocus = 250;

		var map; //complex object of type OpenLayers.Map
		var layer;
		var layersVisible = {};
		var layersCreated = {};

		function init() {
			map = new OpenLayers.Map("osmMap", {
				controls: [
					new OpenLayers.Control.Navigation(),
					new OpenLayers.Control.PanZoomBar(),
					new OpenLayers.Control.LayerSwitcher(),
					new OpenLayers.Control.Attribution()],
				maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34),
				maxResolution: 156543.0399,
				numZoomLevels: 19,
				units: 'm',
				projection: new OpenLayers.Projection("EPSG:900913"),
				displayProjection: new OpenLayers.Projection("EPSG:4326")
			});

			// Define the map layer
			// Here we use a predefined layer that will be kept up to date with URL changes
			var layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik");
			map.addLayer(layerMapnik);
			var layerCycleMap = new OpenLayers.Layer.OSM.CycleMap("CycleMap");
			map.addLayer(layerCycleMap);
			var layerMarkers = new OpenLayers.Layer.Markers("Markers");
			map.addLayer(layerMarkers);

			map.setCenter(new OpenLayers.LonLat(defaultLat, defaultLon) // Center of the map
					.transform(
							new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
							new OpenLayers.Projection("EPSG:900913") // to Spherical Mercator Projection
							), defaultZoom // Zoom level
					);


			// Add the Layer with the GPX Track
//			var lgpx = new OpenLayers.Layer.Vector("Lakeside cycle ride", {
//				strategies: [new OpenLayers.Strategy.Fixed()],
//				protocol: new OpenLayers.Protocol.HTTP({
//					url: 'gpx/2014.06.01_Dandelberg_Alm.gpx',
//					format: new OpenLayers.Format.GPX()
//				}),
//				style: {strokeColor: "red", strokeWidth: 5, strokeOpacity: 0.5},
//				projection: new OpenLayers.Projection("EPSG:4326")
//			});
//			map.addLayer(lgpx);
//			focus(lgpx);<commit_msg>* bugfix: osm init  - lat lon swaped<commit_after>'use strict';
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


angular.module('gpxViewer').controller('osmDirCtrl', ['$scope', 'gpxParser',
	function($scope, gpxParser) {
		var log = log4javascript.getLogger("gpxViewer.directives.osmDirCtrl");
		log.debug('creating directive controller: osmDirCtrl');

		// default map position (Grossarl)
		var defaultLat = 47.2391;
		var defaultLon = 13.1967;
		var defaultZoom = 12;

		// time for scope change
		var asyncExecTimeChanged = 50;

		// time for osm to focus map (gpx files must be loaded)
		var asyncExecTimeFocus = 250;

		var map; //complex object of type OpenLayers.Map
		var layer;
		var layersVisible = {};
		var layersCreated = {};

		function init() {
			log.debug("init()");
			map = new OpenLayers.Map("osmMap", {
				controls: [
					new OpenLayers.Control.Navigation(),
					new OpenLayers.Control.PanZoomBar(),
					new OpenLayers.Control.LayerSwitcher(),
					new OpenLayers.Control.Attribution()],
				maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34),
				maxResolution: 156543.0399,
				numZoomLevels: 19,
				units: 'm',
				projection: new OpenLayers.Projection("EPSG:900913"),
				displayProjection: new OpenLayers.Projection("EPSG:4326")
			});

			// Define the map layer
			// Here we use a predefined layer that will be kept up to date with URL changes
			var layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik");
			map.addLayer(layerMapnik);
			var layerCycleMap = new OpenLayers.Layer.OSM.CycleMap("CycleMap");
			map.addLayer(layerCycleMap);
			var layerMarkers = new OpenLayers.Layer.Markers("Markers");
			map.addLayer(layerMarkers);

			map.setCenter(new OpenLayers.LonLat(defaultLon, defaultLat) // Center of the map
					.transform(
							new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
							new OpenLayers.Projection("EPSG:900913") // to Spherical Mercator Projection
							), defaultZoom // Zoom level
					);


			// Add the Layer with the GPX Track
//			var lgpx = new OpenLayers.Layer.Vector("Lakeside cycle ride", {
//				strategies: [new OpenLayers.Strategy.Fixed()],
//				protocol: new OpenLayers.Protocol.HTTP({
//					url: 'gpx/2014.06.01_Dandelberg_Alm.gpx',
//					format: new OpenLayers.Format.GPX()
//				}),
//				style: {strokeColor: "red", strokeWidth: 5, strokeOpacity: 0.5},
//				projection: new OpenLayers.Projection("EPSG:4326")
//			});
//			map.addLayer(lgpx);
//			focus(lgpx);
{'fraction_non_alphanumeric': 0.1286426380368098, 'fraction_numerical': 0.04256134969325153, 'mean_word_length': 3.5763157894736843, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3920879', 'n_tokens_mistral': 2195, 'n_tokens_neox': 1728, 'n_words': 431}