-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsocratadata.html
42 lines (35 loc) · 2.71 KB
/
socratadata.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
<html>
<head>
<title>Socrata - Google Map Component</title>
<link rel="stylesheet" type="text/css" href="./resources/js/socrata-googlemaps.css">
<script src="https://code.jquery.com/jquery-1.12.3.js" integrity="sha256-1XMpEtA4eKXNNpXcJ1pmMPs8JV+nwLdEqwiJeCQEkyc=" crossorigin="anonymous"></script>
<script src='https://maps.googleapis.com/maps/api/js?sensor=true'></script>
<script src='./resources/js/socrata-googlemaps.js'></script>
<script>
$(function () {
sgm = new SocrataGoogleMaps({
baseUrl: 'https://data.douglas.co.us',
table: 't3ja-9fqv',
formatData: [{
field: 'location_1.human_address',
type: 'parse'
}],
latitude: 'location_1.latitude',
longitude: 'location_1.longitude',
tplListing: '{%=o.organization_name%}',
tplInfowindow: '<b>{%=o.organization_name%}</b><br>{% if(o.location_1 && o.location_1.human_address && o.location_1.human_address.address) { %} {%=o.location_1.human_address.address%}<br>{% } %}{% if(o.location_1 && o.location_1.human_address && o.location_1.human_address.city) { %} {%=o.location_1.human_address.city%}, {% } %}{% if(o.location_1 && o.location_1.human_address && o.location_1.human_address.state) { %} {%=o.location_1.human_address.state%} {% } %}{% if(o.location_1 && o.location_1.human_address && o.location_1.human_address.zip) { %} {%=o.location_1.human_address.zip%} {% } %}{% if(o.telephone) { %}<br>Phone: {%=o.telephone%}<br>{% } %}{% if(o.web_page_address && o.web_page_address.url) { %}<a target="_blank" href="{%=o.web_page_address.url%}">{%=o.web_page_address.url%}</a><br>{% } %}{% if(o.areas_served) { %}Service Area: {%=o.areas_served%}<br>{% } %}',
tplDirections: '{% if(o.location_1 && o.location_1.human_address && o.location_1.human_address.address) { %}{%=o.location_1.human_address.address%}{% } %}{% if(o.location_1 && o.location_1.human_address && o.location_1.human_address.city) { %} {%=o.location_1.human_address.city%}, {% } %}{% if(o.location_1 && o.location_1.human_address && o.location_1.human_address.state) { %}{%=o.location_1.human_address.state%} {% } %}{% if(o.location_1 && o.location_1.human_address && o.location_1.human_address.zip) { %} {%=o.location_1.human_address.zip%} {% } %}'
}).render('sgm').load({
// category: 'Caregiver-Respite Support',
$order: 'organization_name'
}, function(el) {
// loaded
console.log("done", sgm.getRecords().length);
});
});
</script>
</head>
<body>
<div id="sgm" class="sgm"></div>
</body>
</html>