GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — redis-geo/src/RedisGeo/RedisGeo/default.html at master · ServiceStackApps/redis-geo

Expand file tree

/

default.html

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
126 lines (112 loc) · 4.32 KB
/

default.html

Copy path

File metadata and controls

126 lines (112 loc) · 4.32 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
<!DOCTYPE html>
<html>
<head>
<title>Simple Map</title>
<meta name="viewport" content="initial-scale=1.0">
<meta charset="utf-8">
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
font-family: "Trebuchet MS", Helvetica, sans-serif;
}
#map {
height: 100%;
width: 70%;
}
#sidebar {
width: 30%;
float: right;
}
#sidebar .inner {
padding: 0 20px;
}
#km {
width: 50px;
}
#info {
display: none;
}
</style>
</head>
<body>
<a href="https://github.com/ServiceStackApps/redis-geo"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
<div id="sidebar">
<div class="inner">
<h3>Redis GEO Example</h3>
<div id="instructions">
Click on Map to find nearest cities using
<a href="http://redis.io/commands/georadius">Redis GEO</a>
</div>
<div id="info">
Find cities in <b id="state"></b> within <input id="km" type="text" value="20" /> km
</div>
<ol id="results"></ol>
</div>
</div>
<div id="map"></div>
<script>
var map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: { lat: 37.09024, lng: -95.7128917 },
zoom: 5
});
var geocoder = new google.maps.Geocoder();
var lastMarker, lastRadius;
google.maps.event.addListener(map, "click", function (e) {
geocoder.geocode({ 'location': e.latLng }, function (results, status) {
if (status === google.maps.GeocoderStatus.OK) {
map.setCenter(e.latLng);
if (lastMarker != null)
lastMarker.setMap(null);
var marker = lastMarker = new google.maps.Marker({
map: map,
position: e.latLng
});
if (lastRadius != null)
lastRadius.setMap(null);
var km = parseInt($("#km").val());
var radius = lastRadius = new google.maps.Circle({
strokeColor: "#c3fc49",
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: "#c3fc49",
fillOpacity: 0.35,
map: map,
center: e.latLng,
radius: km * 1000
});
radius.bindTo('center', marker, 'position');
var state = getStateAbbr(results);
$("#state").html(state);
$("#instructions").hide();
$("#info").show();
$.getJSON("/georesults/" + state,
{ lat: e.latLng.lat(), lng: e.latLng.lng(), withinKm: km },
function (r) {
var html = $.map(r, function (x) {
return "<li>" + x.member + " (" + x.distance.toFixed(2) + "km)</li>";
}).join('');
$("#results").html(html);
});
}
});
});
function getStateAbbr(results) {
for (var i = 0; i < results.length; i++) {
for (var j = 0; j < results[i].address_components.length; j++) {
var addr = results[i].address_components[j];
if (addr.types.indexOf("administrative_area_level_1") >= 0)
return addr.short_name;
}
}
return null;
}
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDz8ab2kD1_JyffvmcBC_asZl0EG0KTOaU&callback=initMap" async defer></script>
<script src="/js/jquery-2.2.3.min.js"></script>
</body>
</html>
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.