From 9c52f36fea59a81705687cb1de9e25e9cc8c2846 Mon Sep 17 00:00:00 2001 From: Lufeng Lin Date: Thu, 28 Mar 2019 23:13:31 -0400 Subject: [PATCH 1/2] =?UTF-8?q?=E2=80=9CWeek9=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/reset.css | 9 +++++++ css/style.css | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++ index.html | 45 ++++++++++++++++++++++++++++++++++ js/main.js | 17 +++++++++++++ 4 files changed, 138 insertions(+) create mode 100644 css/reset.css create mode 100644 css/style.css create mode 100644 index.html create mode 100644 js/main.js diff --git a/css/reset.css b/css/reset.css new file mode 100644 index 0000000..f2104e9 --- /dev/null +++ b/css/reset.css @@ -0,0 +1,9 @@ +/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0} + +html { + box-sizing: border-box; +} + +*, *:before, *:after { + box-sizing: inherit; +} diff --git a/css/style.css b/css/style.css new file mode 100644 index 0000000..6810a11 --- /dev/null +++ b/css/style.css @@ -0,0 +1,67 @@ +body { + padding: 0; + overflow: hidden; + font-family: colfax, helvetica, arial, sans-serif; +} + +p.main { + text-align: justify; + font-size: 16px; +} + +.slide { + font-size: 14px; +} + +.map { + position: absolute; + right: 0px; + left: 38.2%; + height: 100%; + top: 0; +} + +.sidebar { + background-color: #EDEDED; + position: absolute; + left: 0px; + width: 38.2%; + top: 0; + bottom: 0; + overflow-y: auto; + padding: 20px; + font-size: 16px; + text-align: justify; + +} + +.legend { + background-color: #fff; + z-index: 2000; + line-height: 20px; + color: #555; + width:120px; + height:180px; + padding: 6px 8px; + box-shadow: 0 0 15px rgba(0,0,0,0.2); + border-radius: 5px; +} + +.legend i { + width: 18px; + height: 18px; + float: left; + margin-right: 8px; +} + +.button { + background-color: #CCCACA; /* Green */ + border: none; + color: white; + padding: 10px 20px; + text-align: center; + text-decoration: none; + font-size: 20px; +} +#next {float:right;} +#previous {float:left;visibility:hidden;} diff --git a/index.html b/index.html new file mode 100644 index 0000000..833249e --- /dev/null +++ b/index.html @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + Display a map + + + + + + +
+ + + + + + + diff --git a/js/main.js b/js/main.js new file mode 100644 index 0000000..07da226 --- /dev/null +++ b/js/main.js @@ -0,0 +1,17 @@ +var phillyCrimeDataUrl = "https://raw.githubusercontent.com/CPLN692-MUSA611/datasets/master/json/philadelphia-crime-snippet.json"; +var crimedata; + +// async ajax call +var getCrimeData = function() { + $.ajax(phillyCrimeDataUrl).done(function(ajaxResponseValue) { + crimedata = JSON.parse(ajaxResponseValue); + console.log(crimedata); + _.forEach(crimedata, function(x){ + L.marker([x.Lat, x.Lng]).addTo(map); + }); + }); + }; + + +// run the ajax function +getCrimeData(); From 76033b35adce3fb9b018c6ae87a4b3ed0696a304 Mon Sep 17 00:00:00 2001 From: Lufeng Lin Date: Thu, 28 Mar 2019 23:33:47 -0400 Subject: [PATCH 2/2] Lufeng Lin-week9 --- README.md | 2 +- index.html | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d1cf0ec..3cfe8d5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Week 9 - +LINK: https://lufenglin.github.io/ *As always: make a copy of this repository to commit changes to* ## Class Outline diff --git a/index.html b/index.html index 833249e..7365351 100644 --- a/index.html +++ b/index.html @@ -11,6 +11,12 @@