forked from MicheleTobias/LiteratureMapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
189 lines (177 loc) · 8.81 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Literature Map</title>
<link rel="stylesheet" type="text/css" href="style.css">
<!--The following script tag downloads a font from the Adobe Edge Web Fonts server for use within the web page. We recommend that you do not modify it.-->
<script>var __adobewebfontsappname__="dreamweaver"</script>
<script src="http://use.edgefonts.net/source-sans-pro:n2:default.js" type="text/javascript"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css"
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"
integrity="sha512-gZwIG9x3wUXg2hdXF6+rVkLF/0Vi9U8D2Ntg4Ga5I5BZpVkVxlJWbSQtXPSiUTtC0TjtGOmxa1AJPuV0CPthew=="
crossorigin=""></script>
</head>
<body>
<!-- Main Container -->
<div class="container">
<!-- Navigation -->
<header> <a href="">
<h4 class="logo">Rangelands Literature Map of Arizona</h4>
</a>
<nav>
<ul>
<li><a href="#hero">HOME</a></li>
<li><a href="#about">ABOUT</a></li>
<li><a href="#contact">CONTACT</a></li>
</ul>
</nav>
</header>
<!--Leaflet Section-->
<div id="mapid"></div>
<section class="body">
<p>
<script type="text/javascript">
var mymap = L.map('mapid').setView([33.4484, -112.0740], 7);
// These are the coordinates for Phoenix AZ
L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}',
{attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
maxZoom: 18,
id: 'mapbox/streets-v11',
tileSize: 512,
zoomOffset: -1,
accessToken: 'pk.eyJ1IjoiYW1hbnRheWEiLCJhIjoiY2thMzMyajRwMGs0bDNnbWVwNDB0cG4wMiJ9.ri0-zHEcTnbvY9QhrjRTNQ'
})
.addTo(mymap);
var osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '& OpenStreetMap'}).addTo(mymap);
//var watercolor = L.tileLayer('http://b.tile.stamen.com/watercolor/{z}/{x}/{y}.png').addTo(mymap);
//all the points with if statement
var myLayer = L.geoJson().addTo(mymap);
var xmlhttp = new XMLHttpRequest();
//var url = 'https://api.zotero.org/users/2338633/collections/NR8XU5N6/items?v=3';
var url = 'https://api.zotero.org/users/6345938/collections/6BBDFZSW/items?v=3';
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
var myArr = JSON.parse(xmlhttp.responseText);
myFunction(myArr);
}
}
xmlhttp.open("GET", url, true);
xmlhttp.send();
function myFunction(arr) {
var parsetext;
var i;
for(i = 0; i < arr.length; i++) {
var pophttp = new XMLHttpRequest();
// var popurl = 'https://api.zotero.org/users/2338633/items/'+ arr[i].data.key +'?format=bib&v=3';
var popurl = 'https://api.zotero.org/users/6345938/items/'+ arr[i].data.key +'?format=bib&v=3';
var extratext = arr[i].data.extra;
var pointtype = extratext.substr(extratext.search('"type":')+9, 1);
console.log(pointtype)
if (pointtype == 'P'){
var extrageom = extratext.substr(extratext.search("<geojson>")+9, (extratext.search("</\\geojson>")-extratext.search("<geojson>"))-9);
console.log(extrageom)
parsetext = '{"type": "Feature", "properties":{"key": "' + arr[i].data.key + '", "popupContent": "<iframe src= '+ popurl + '></> + "}, "geometry":' + extrageom + '}';
console.log(parsetext)
var geojsonFeature = JSON.parse(parsetext);
L.geoJson(geojsonFeature, {
pointToLayer: function (feature, latlng) {
return L.circleMarker(latlng, {
radius: 4,
fillOpacity: 1
}).bindPopup(feature.properties.popupContent);
}
}).addTo(myLayer);
} else {
var extrageom = extratext.substr(extratext.search("coordinates")+14, (extratext.search("}</\\geojson>")-extratext.search("coordinates"))-14);
parsetext = '{"type": "Feature", "properties":{"key": "' + arr[i].data.key + '", "popupContent": "<iframe src= '+ popurl + '></> + "}, "geometry": {"type": "MultiPoint", "coordinates":' + extrageom + '}}';
var geojsonFeatureMultiPoints = JSON.parse(parsetext);
L.geoJson(geojsonFeatureMultiPoints, {
pointToLayer: function (feature, latlng) {
return L.circleMarker(latlng, {
radius: 4,
fillOpacity: 1
}).bindPopup(feature.properties.popupContent);
}
}).addTo(myLayer);
}
}};
</script>
</p>
</section>
<!-- About Section -->
<section class="about" id="about">
<h2 class="hidden">About</h2>
<p class="text_column">The Rangelands Literature Map of Arizona is a pilot project developed by Andrew Antaya, Cody Wooden, and Jeanne Pfander from the University of Arizona, funded by the U.S Agricultural Information Network (USAIN). This map uses open source software to geo-reference/geo-tag journal articles from the Journal of Range Management/Rangeland Ecology & Management, and displays the article citations on an interative web map. The goal of this project is to demonstrate the feasibility of adding geographic coordinates to journal articles, with the intent of re-thinking how we approach literature searches. Integration of this tool into literature databases will help us refine searching, away from keywords and towards place-based searching.</p>
<p class="text_column">This map is built using the LiteratureMapper plugin for QGIS, an open-source project created by Michele Tobias and Alex Mandel. Please checkout the link below to see other projects created using LiteratureMapper.</p>
<p class="text" align="center">
<a href="http://micheletobias.github.io/maps/LiteratureMap.html">Credit: Tobias, M.M. & A.I. Mandel. 2015. Beach Plant Literature Map.</a>
</p>
</section>
<!-- Stats Gallery Section -->
<!--
<div class="gallery">
<div class="thumbnail">
<h1 class="stats">1500</h1>
<h4>TITLE</h4>
<p>One line description</p>
</div>
<div class="thumbnail">
<h1 class="stats">2300</h1>
<h4>TITLE</h4>
<p>One line description</p>
</div>
<div class="thumbnail">
<h1 class="stats">7500</h1>
<h4>TITLE</h4>
<p>One line description</p>
</div>
<div class="thumbnail">
<h1 class="stats">9870</h1>
<h4>TITLE</h4>
<p>One line description</p>
</div>
</div>
-->
<!-- Parallax Section -->
<!--
<section class="banner">
<h2 class="parallax">PARALLAX HERO</h2>
<p class="parallax_description">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam</p>
</section>
More Info Section
<footer>
<article class="footer_column">
<h3>ABOUT</h3>
<img src="file:///C|/Users/Andrew/AppData/Roaming/Adobe/Dreamweaver 2020/en_US/Configuration/Temp/Assets/eam160D.tmp/images/placeholder.jpg" alt="" width="400" height="200" class="cards"/>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla </p>
</article>
<article class="footer_column">
<h3>LOCATION</h3>
<img src="file:///C|/Users/Andrew/AppData/Roaming/Adobe/Dreamweaver 2020/en_US/Configuration/Temp/Assets/eam160D.tmp/images/placeholder.jpg" alt="" width="400" height="200" class="cards"/>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla </p>
</article>
</footer>
-->
<!-- Footer Section -->
<section class="footer_banner" id="contact">
<h2 class="hidden">Footer Banner Section </h2>
<p class="hero_header">Contact: aantaya[at]arizona.edu</p>
</section>
<!-- Copyrights Section -->
<!-- <div class="copyright">©2019- <strong>Light Theme</strong></div>-->
</div>
<!-- Main Container Ends -->
</body>
</html>