<commit_before>define([
	'marionette',
	'leaflet',
	'd3',

	'vent',

	'app/collections/parcelsCollection',
	'app/models/parcelModel',
	'app/collections/cityCollection',
	'app/collections/assetCollection',
	'app/collections/investmentCollection',
	'app/models/assetModel',
	'app/models/investmentModel',

	'config'

],function(
	Marionette,
	L,
	d3,

	vent,

	parcelsCollection,
	ParcelModel,
	cityCollection,
	assetCollection,
	investmentCollection,
	AssetModel,
	InvestmentModel,

	config
){

	//module internal variables for keeping leaflet+d3
	var map, svg, g, features, editMarker, parcelMarker, clusterGroup;
	var mapBackground = {};

	var cityIcon = L.icon({
		iconUrl:'../style/assets/pin-02.png',
		iconSize:[20,46],
		iconAnchor:[10,46]
	});
	var cityIconHighlight = L.icon({
		iconUrl:'../style/assets/pin-03.png',
		iconSize:[20,46],
		iconAnchor:[10,46]
	});
	var cityIconHash = {};

	var assetIconEdit = L.icon({
		iconUrl:'../style/assets/pin_asset-edit.png',
		iconSize:[30,30],
		iconAnchor:[15,15]
	});
	var investmentIconEdit = L.icon({
		iconUrl:'../style/assets/pin_investment-edit.png',
		iconSize:[30,30],
		iconAnchor:[15,15]
	});
	var assetIcon = L.icon({
		iconUrl:'../style/assets/pin_asset.png',
		iconSize:[30,30],
		iconAnchor:[15,15]
	});
	var investmentIcon = L.icon({
		iconUrl:'../style/assets/pin_investment.png',
		iconSize:[30,30],
		iconAnchor:[15,15]
	});

	var investmentIconPrivate = L.icon({
		iconUrl:'../style/assets/pin_investment_private.png',
		iconSize:[30,30],
		iconAnchor:[15,15]
	});

	var parcelIcon = L.icon({
		iconUrl:'../style/assets/pin-04.png',
		iconSize:[20,46],
		iconAnchor:[10,46]
	});

	var assetIconClasses = { business: L.icon({
		iconUrl:'../style/assets/business.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}),

	parking: L.icon({
		iconUrl:'../style/assets/parking.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}),

		community: L.icon({
		iconUrl:'../style/assets/community.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}),

		culture: L.icon({
		iconUrl:'../style/assets/culture.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}),

		education: L.icon({
		iconUrl:'../style/assets/education.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}),

		food: L.icon({
		iconUrl:'../style/assets/food.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}),

		government: L.icon({
		iconUrl:'../style/assets/government.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}),

		health: L.icon({
		iconUrl:'../style/assets/health.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}),

		park: L.icon({
		iconUrl:'../style/assets/park.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}),

		retail: L.icon({
		iconUrl:'../style/assets/retail.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}),

	// 	bank: L.icon({
	// 	iconUrl:'../style/assets/bank.png',
	// 	iconSize:[40,40],
	// 	iconAnchor:[15,15]
	// }),

	temporary: L.icon({
		iconUrl:'../style/assets/temporary.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}) };

	var assetMarkerHash = d3.map(), investmentMarkerHash = d3.map(); //allows one to one look-up between map icons and asset models


	function projectPoint(x,y){
		var point = map.latLngToLayerPoint(new L.LatLng(y,x));
		this.stream.point(point.x,point.y);
	}
	var transform = d3.geo.transform({point:projectPoint}),
		path = d3.geo.path().projection(transform);


	//mapView
	var MapView = Marionette.ItemView.extend({
		//parcelsCollection rendered as an itemView

		className:'map-inner',
		template:false,
		currentLayer:undefined,
		filterObject: {
			activating: true
		},
		collection:parcelsCollection, //use itemView to render a collection

		initialize:function(){
			//listen to only the initial population of the parcelsCollection
			this.listenToOnce(this.collection, 'sync', this.drawParcels);

		},

		onShow:function(){
			var that = this;
			console.log('mapView:show');

			//upon mapView:show, initialize leaflet map
			map = L.map(this.el).setView([42.3, -71.8], 9);
			mapBackground.satellite = L.tileLayer('https://a.tiles.mapbox.com/v4/siqizhu01.nok599k9/{z}/{x}/{y}.png?access_token=<KEY>')
				.addTo(map);
			mapBackground.street = L.tileLayer('https://api.mapbox.com/styles/v1/nmonani/ciq9iw3fg00b0cam12nj4wieq/tiles/256/{z}/{x}/{y}?access_token=<KEY>')
				.addTo(map);

			clusterGroup = L.markerClusterGroup({disableClusteringAtZoom: 17});

<commit_msg>Adds a Min Zoom and max bounds to limit extents. Closes #33<commit_after>define([
	'marionette',
	'leaflet',
	'd3',

	'vent',

	'app/collections/parcelsCollection',
	'app/models/parcelModel',
	'app/collections/cityCollection',
	'app/collections/assetCollection',
	'app/collections/investmentCollection',
	'app/models/assetModel',
	'app/models/investmentModel',

	'config'

],function(
	Marionette,
	L,
	d3,

	vent,

	parcelsCollection,
	ParcelModel,
	cityCollection,
	assetCollection,
	investmentCollection,
	AssetModel,
	InvestmentModel,

	config
){

	//module internal variables for keeping leaflet+d3
	var map, svg, g, features, editMarker, parcelMarker, clusterGroup;
	var mapBackground = {};

	var cityIcon = L.icon({
		iconUrl:'../style/assets/pin-02.png',
		iconSize:[20,46],
		iconAnchor:[10,46]
	});
	var cityIconHighlight = L.icon({
		iconUrl:'../style/assets/pin-03.png',
		iconSize:[20,46],
		iconAnchor:[10,46]
	});
	var cityIconHash = {};

	var assetIconEdit = L.icon({
		iconUrl:'../style/assets/pin_asset-edit.png',
		iconSize:[30,30],
		iconAnchor:[15,15]
	});
	var investmentIconEdit = L.icon({
		iconUrl:'../style/assets/pin_investment-edit.png',
		iconSize:[30,30],
		iconAnchor:[15,15]
	});
	var assetIcon = L.icon({
		iconUrl:'../style/assets/pin_asset.png',
		iconSize:[30,30],
		iconAnchor:[15,15]
	});
	var investmentIcon = L.icon({
		iconUrl:'../style/assets/pin_investment.png',
		iconSize:[30,30],
		iconAnchor:[15,15]
	});

	var investmentIconPrivate = L.icon({
		iconUrl:'../style/assets/pin_investment_private.png',
		iconSize:[30,30],
		iconAnchor:[15,15]
	});

	var parcelIcon = L.icon({
		iconUrl:'../style/assets/pin-04.png',
		iconSize:[20,46],
		iconAnchor:[10,46]
	});

	var assetIconClasses = { business: L.icon({
		iconUrl:'../style/assets/business.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}),

	parking: L.icon({
		iconUrl:'../style/assets/parking.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}),

		community: L.icon({
		iconUrl:'../style/assets/community.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}),

		culture: L.icon({
		iconUrl:'../style/assets/culture.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}),

		education: L.icon({
		iconUrl:'../style/assets/education.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}),

		food: L.icon({
		iconUrl:'../style/assets/food.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}),

		government: L.icon({
		iconUrl:'../style/assets/government.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}),

		health: L.icon({
		iconUrl:'../style/assets/health.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}),

		park: L.icon({
		iconUrl:'../style/assets/park.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}),

		retail: L.icon({
		iconUrl:'../style/assets/retail.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}),

	temporary: L.icon({
		iconUrl:'../style/assets/temporary.png',
		iconSize:[40,40],
		iconAnchor:[15,15]
	}) };

	var assetMarkerHash = d3.map(), investmentMarkerHash = d3.map(); //allows one to one look-up between map icons and asset models


	function projectPoint(x,y){
		var point = map.latLngToLayerPoint(new L.LatLng(y,x));
		this.stream.point(point.x,point.y);
	}
	var transform = d3.geo.transform({point:projectPoint}),
		path = d3.geo.path().projection(transform);


	//mapView
	var MapView = Marionette.ItemView.extend({
		//parcelsCollection rendered as an itemView

		className:'map-inner',
		template:false,
		currentLayer:undefined,
		filterObject: {
			activating: true
		},
		collection:parcelsCollection, //use itemView to render a collection

		initialize:function(){
			//listen to only the initial population of the parcelsCollection
			this.listenToOnce(this.collection, 'sync', this.drawParcels);

		},

		onShow:function(){
			var that = this;
			console.log('mapView:show');

			//upon mapView:show, initialize leaflet map
			map = L.map(this.el, { maxBounds: [[41.253,-73.5081],[42.8867,-69.8621]], minZoom: 9 }).setView([42.3, -71.8], 9);
			mapBackground.satellite = L.tileLayer('https://a.tiles.mapbox.com/v4/siqizhu01.nok599k9/{z}/{x}/{y}.png?access_token=<KEY>')
				.addTo(map);
			mapBackground.street = L.tileLayer('https://api.mapbox.com/styles/v1/nmonani/ciq9iw3fg00b0cam12nj4wieq/tiles/256/{z}/{x}/{y}?access_token=<KEY>WZ58CM60Y0Q')
				.addTo(map);

			clusterGroup = L.markerClusterGroup({disableClusteringAtZoom: 17});


{'fraction_non_alphanumeric': 0.18946765884373212, 'fraction_numerical': 0.048654836863194044, 'mean_word_length': 4.234272019173158, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, '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': '902333', 'n_tokens_mistral': 3897, 'n_tokens_neox': 3276, 'n_words': 491}