-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4bb198
commit 3e0a49e
Showing
9 changed files
with
190 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* Created by matt on 3/20/15. | ||
*/ | ||
|
||
var mongoose = require('mongoose'); | ||
|
||
var addressSchema = mongoose.Schema({ | ||
address: String, | ||
geoInfo: Object | ||
}); | ||
|
||
addressSchema.index({"address": 1}); | ||
|
||
var Address = mongoose.model('Address', addressSchema); | ||
module.exports = Address; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,4 +32,10 @@ body { | |
|
||
.revision .subject { | ||
display: block; | ||
} | ||
|
||
#map-canvas { | ||
display: block; | ||
width: 100%; | ||
height: 500px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<div id="map-canvas"></div> | ||
|
||
{{#section 'header'}} | ||
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key={{ mapsApiKey }}"> | ||
</script> | ||
{{/section}} | ||
|
||
{{#section 'jquery'}} | ||
<script type="text/javascript"> | ||
var packages = {}; | ||
{{#each packages}} | ||
packages["{{_id}}"] = { | ||
location: { | ||
latitude: {{location.latitude}}, | ||
longitude: {{location.longitude}} | ||
}, | ||
description: "{{description}}" | ||
}; | ||
{{/each}} | ||
function initialize() { | ||
var mapOptions = { | ||
center: { lat: 39.156, lng: 263.808 }, | ||
zoom: 4 | ||
}; | ||
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); | ||
globalMap = map; | ||
for (var packageId in packages) { | ||
var pos = new google.maps.LatLng(packages[packageId].location.latitude, packages[packageId].location.longitude); | ||
var marker = new google.maps.Marker({ | ||
position: pos, | ||
map: map, | ||
title: packages[packageId].description | ||
}); | ||
} | ||
} | ||
google.maps.event.addDomListener(window, 'load', initialize); | ||
</script> | ||
{{/section}} |