jQuery(document).ready(function(){

	//initialize();

  
	
			
		jQuery('#map1').jmap('init', {'mapType':'map','mapZoom':13,'mapControl':'large','mapEnableType':'true','mapCenter':[51.549999, -0.050000]});
		


		//plotter: http://www.katapi.org.uk/Maps/GoogleMaps/GMPolylineDistPlotter.html
	
		
		//Stoke Newington
		jQuery('#map1').jmap('AddPolygon', {
			'polygonPoints': [
				[51.552059,-0.074952], 
				[51.552273,-0.075059], 
				[51.551699,-0.079393], 
				[51.552073,-0.085402], 
				[51.552873,-0.087633], 
				[51.553901,-0.088534], 
				[51.553740,-0.089350], 
				[51.554154,-0.090294], 
				[51.557783,-0.090444], 
				[51.560091,-0.091667], 
				[51.560531,-0.093813], 
				[51.561238,-0.095959], 
				[51.560851,-0.098662], 
				[51.564720,-0.104434], 
				[51.570642,-0.096066], 
				[51.573922,-0.097761], 
				[51.574816,-0.086367], 
				[51.575896,-0.080402], 
				[51.575003,-0.075939], 
				[51.576096,-0.075037], 
				[51.576123,-0.072548], 
				[51.576123,-0.072548], 
				[51.575603,-0.072377], 
				[51.576443,-0.067012], 
				[51.576643,-0.067055], 
				[51.577750,-0.061369],
				[51.573296,-0.058730], 
				[51.572642,-0.058987], 
				[51.568708,-0.053687], 
				[51.567507,-0.051262], 
				[51.563919,-0.054202], 
				[51.563532,-0.058837], 
				[51.562972,-0.058258], 
				[51.562439,-0.060189], 
				[51.562799,-0.062184], 
				[51.562972,-0.064523], 
				[51.562345,-0.066605], 
				[51.562759,-0.071454], 
				[51.558290,-0.069330], 
				[51.555568,-0.068128], 
				[51.554061,-0.068707],
				[51.553914,-0.071433], 
				[51.553487,-0.071604], 
				[51.553407,-0.074780],
				[51.552059,-0.074952]				
			],
				

			
			'polygonStrokeColor': '#ee2c73',
			'polygonStrokeWeight': 0,
			'polygonStrokeOpacity': 1,
			'polygonFillColor': '#007e7a',
			'polygonFillOpacity': 0.5});
		//end plotter
		
		//Hackney Wick
		jQuery('#map1').jmap('AddPolygon', {
			'polygonPoints': [
				[51.563052,-0.058150],
				[51.563466,-0.058515],
				[51.563813,-0.054095],
				[51.567334,-0.051091],
				[51.565173,-0.047679],
				[51.563853,-0.046778],
				[51.563132,-0.047593],
				[51.562439,-0.047421],
				[51.562065,-0.046306],
				[51.561545,-0.044096],
				[51.561105,-0.042143],
				[51.561451,-0.040126],
				[51.560811,-0.038474],
				[51.561198,-0.036263],
				[51.560344,-0.033753],
				[51.561038,-0.030642],
				[51.558623,-0.024869],
				[51.557356,-0.024440],
				[51.554528,-0.017574],
				[51.553780,-0.017767],
				[51.551472,-0.017188],
				[51.551325,-0.019312],
				[51.544987,-0.016844],
				[51.544387,-0.016716],
				[51.544133,-0.021844],
				[51.543413,-0.025513],
				[51.542225,-0.028839],
				[51.543159,-0.029762],
				[51.543653,-0.031242],
				[51.544760,-0.032830],
				[51.541491,-0.038087],
				[51.540997,-0.046177],
				[51.541371,-0.046263],
				[51.541638,-0.048816],
				[51.542625,-0.048838],
				[51.545081,-0.046048],
				[51.545308,-0.041671],
				[51.547109,-0.041885],
				[51.547269,-0.040319],
				[51.548750,-0.040941],
				[51.548870,-0.039718],
				[51.553767,-0.041800],
				[51.552753,-0.049331],
				[51.551939,-0.052292],
				[51.556209,-0.055511],
				[51.558810,-0.055876],
				[51.562839,-0.057957],
				[51.563052,-0.058150]
			],		
			'polygonStrokeColor': '#007e7a',
			'polygonStrokeWeight': 0,
			'polygonStrokeOpacity': 1,
			'polygonFillColor': '#ee2c73',
			'polygonFillOpacity': 0.5});
		
		//Hackney Central
		jQuery('#map1').jmap('AddPolygon', {
			'polygonPoints': [
				[51.562799,-0.057979], 
				[51.562905,-0.058172],
				[51.562399,-0.060403],
				[51.562679,-0.061905],
				[51.562879,-0.064566],
				[51.562278,-0.066605],
				[51.562625,-0.071154],
				[51.557263,-0.068772],
				[51.557169,-0.068622],
				[51.555542,-0.068064],
				[51.555448,-0.066669],
				[51.553113,-0.065210],
				[51.551953,-0.063879],
				[51.551139,-0.068493],
				[51.548270,-0.067956],
				[51.547816,-0.068858],
				[51.547656,-0.068686],
				[51.547429,-0.065639],
				[51.546001,-0.064330],
				[51.545841,-0.063686],
				[51.545414,-0.063429],
				[51.545348,-0.064502],
				[51.543279,-0.064394],
				[51.543599,-0.059824],
				[51.543373,-0.057528],
				[51.543626,-0.055361],
				[51.540810,-0.055168],
				[51.539769,-0.055876],
				[51.538301,-0.057185],
				[51.534711,-0.057163],
				[51.534738,-0.057206],
				[51.534738,-0.057206],
				[51.535205,-0.055039],
				[51.535045,-0.053022],
				[51.536366,-0.051842],
				[51.536473,-0.051177],
				[51.535832,-0.048451],
				[51.535525,-0.047228],
				[51.535872,-0.044739],
				[51.536660,-0.043817],
				[51.536553,-0.043323],
				[51.538194,-0.040491],
				[51.541291,-0.037293],
				[51.541371,-0.038195],
				[51.540904,-0.046220],
				[51.541304,-0.046370],
				[51.541598,-0.048902],
				[51.542665,-0.048988],
				[51.545174,-0.046177],
				[51.545414,-0.041800],
				[51.547149,-0.042100],
				[51.547336,-0.040448],
				[51.548790,-0.041242],
				[51.548950,-0.039804],
				[51.553647,-0.041842],
				[51.552620,-0.049331],
				[51.551779,-0.052335],
				[51.556222,-0.055683],
				[51.558863,-0.056090],
				[51.562745,-0.058043],
				[51.562799,-0.057979]
			],
			'polygonStrokeColor': '#fbb033',
			'polygonStrokeWeight': 0,
			'polygonStrokeOpacity': 1,
			'polygonFillColor': '#fbb033',
			'polygonFillOpacity': 0.5});
		
			
		//Haggerston
		jQuery('#map1').jmap('AddPolygon', {
			'polygonPoints': [
				[51.526261,-0.084286],
				[51.526248,-0.084908],
				[51.525527,-0.084629],
				[51.524592,-0.085402],
				[51.524459,-0.085208],
				[51.524472,-0.085208],
				[51.523925,-0.085187],
				[51.523885,-0.084286],
				[51.523364,-0.084436],
				[51.520333,-0.085144],
				[51.520093,-0.083513],
				[51.519813,-0.083299],
				[51.519813,-0.083299],
				[51.520921,-0.081518],
				[51.521935,-0.081046],
				[51.521575,-0.078449],
				[51.522002,-0.078170],
				[51.522483,-0.075359],
				[51.523658,-0.075359],
				[51.523604,-0.075746],
				[51.524325,-0.075939],
				[51.524339,-0.076518],
				[51.526301,-0.076711],
				[51.527142,-0.076325],
				[51.527302,-0.077248],
				[51.529211,-0.074973],
				[51.530212,-0.074008],
				[51.530947,-0.071819],
				[51.531174,-0.066261],
				[51.533122,-0.065145],
				[51.532922,-0.064931],
				[51.533296,-0.062184],
				[51.535071,-0.062892],
				[51.535498,-0.062485],
				[51.535672,-0.068450],
				[51.535792,-0.070188],
				[51.538822,-0.070338],
				[51.538915,-0.073686],
				[51.538608,-0.073128],
				[51.538368,-0.076840],
				[51.533269,-0.077162],
				[51.533162,-0.080101],
				[51.530172,-0.080252],
				[51.529251,-0.079994],
				[51.528117,-0.080123],
				[51.528050,-0.083621],
				[51.526435,-0.083814]
			],		
			'polygonStrokeColor': '#ee2c73',
			'polygonStrokeWeight': 0,
			'polygonStrokeOpacity': 1,
			'polygonFillColor': '#c9243f',
			'polygonFillOpacity': 0.5});
	
		//Dalston
		jQuery('#map1').jmap('AddPolygon', {
			'polygonPoints': [
				[51.553047,-0.074887],
				[51.552246,-0.074952],
				[51.551966,-0.079007],
				[51.551686,-0.079372],
				[51.549471,-0.077698],
				[51.547242,-0.076389],
				[51.546322,-0.076303],
				[51.546068,-0.076711],
				[51.546122,-0.075617],
				[51.542372,-0.076325],
				[51.538408,-0.076776],
				[51.538528,-0.073128],
				[51.538875,-0.073535],
				[51.539035,-0.073729],
				[51.538848,-0.070231],
				[51.535872,-0.070081],
				[51.535578,-0.062613],
				[51.535311,-0.061755],
				[51.534364,-0.060318],
				[51.534204,-0.059524],
				[51.534484,-0.057378],
				[51.537927,-0.057163],
				[51.538421,-0.057313],
				[51.540850,-0.055382],
				[51.543546,-0.055532],
				[51.543306,-0.057743],
				[51.543559,-0.059717],
				[51.543279,-0.062506],
				[51.543172,-0.064394],
				[51.545374,-0.064673],
				[51.545468,-0.063622],
				[51.545828,-0.063837],
				[51.545855,-0.064352],
				[51.547443,-0.065746],
				[51.547683,-0.068879],
				[51.548163,-0.068557],
				[51.548310,-0.067892],
				[51.551245,-0.068235],
				[51.551566,-0.066991],
				[51.551913,-0.064073],
				[51.552887,-0.065339],
				[51.555448,-0.066862],
				[51.555488,-0.068064],
				[51.554127,-0.068815],
				[51.553967,-0.069008],
				[51.553500,-0.069609],
				[51.553780,-0.070553],
				[51.553780,-0.071154],
				[51.553500,-0.071197],
				[51.553460,-0.074780],
				[51.553047,-0.074887]
			],		
			'polygonStrokeColor': '#ee2c73',
			'polygonStrokeWeight': 0,
			'polygonStrokeOpacity': 1,
			'polygonFillColor': '#4e4cac',
			'polygonFillOpacity': 0.5});
		
		//Shoreditch
		jQuery('#map1').jmap('AddPolygon', {
			'polygonPoints': [
				[51.546041,-0.075810],
				[51.545975,-0.076797],
				[51.546509,-0.083706],
				[51.545014,-0.083492],
				[51.537354,-0.086517],
				[51.537007,-0.087612],
				[51.536019,-0.089650],
				[51.532802,-0.096860],
				[51.529946,-0.095079],
				[51.529185,-0.095465],
				[51.527409,-0.088620],
				[51.525927,-0.087633],
				[51.526074,-0.086989],
				[51.526755,-0.083749],
				[51.528130,-0.083706],
				[51.528250,-0.080316],
				[51.529972,-0.080402],
				[51.533189,-0.080209],
				[51.533216,-0.077376],
				[51.536393,-0.077119],
				[51.541491,-0.076625],
				[51.546015,-0.075831],
				[51.546041,-0.075810]
			],		
			'polygonStrokeColor': '#6cbd6a',
			'polygonStrokeWeight': 0,
			'polygonStrokeOpacity': 1,
			'polygonFillColor': '#6cbd6a',
			'polygonFillOpacity': 0.5});	


	
point1 = new Array(51.565120,-0.074372,'<div class="marker"><h2>Stoke Newington</h2><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy.</p><p><a href="http://www.invest-in-hackney.org/about-hackney/inside-hackney/stoke-newington">Click here</a> for more info</p></div>');
point2 = new Array(51.554421,-0.034075,'<div class="marker"><h2>Hackney Wick</h2><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy.</p><p><a href="http://www.invest-in-hackney.org/about-hackney/inside-hackney/hackney-wick/">Click here</a> for more info</p></div>');
point3 = new Array(51.547229,-0.055168,'<div class="marker"><h2>Hackney Central</h2><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy.</p><p><a href="http://www.invest-in-hackney.org/about-hackney/inside-hackney/hackney-central/">Click here</a> for more info</p></div>');
point4 = new Array(51.533122,-0.067720,'<div class="marker"><h2>Haggerston</h2><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy.</p><p><a href="http://www.invest-in-hackney.org/about-hackney/inside-hackney/haggerston">Click here</a> for more info</p></div>');
point5 = new Array(51.528797,-0.081496,'<div class="marker"><h2>Shoreditch</h2><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy.</p><p><a href="http://www.invest-in-hackney.org/about-hackney/inside-hackney/shoreditch">Click here</a> for more info</p></div>');
point6 = new Array(51.548417,-0.075746,'<div class="marker"><h2>Dalston</h2><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy.</p><p><a href="hhttp://www.invest-in-hackney.org/about-hackney/inside-hackney/dalston/">Click here</a> for more info</p></div>');

pointsToPlot = new Array(point1,point2,point3,point4,point5,point6);


	for (var i = 0; i < pointsToPlot.length; i++) {
			jQuery('#map1').jmap('AddMarker', {
			'pointLatLng': [pointsToPlot[i][0], pointsToPlot[i][1]],
			'pointHTML': pointsToPlot[i][2]
			});
 }
	
	
	
});