-
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
Showing
10 changed files
with
125 additions
and
3 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,37 @@ | ||
/* jshint unused:false, camelcase:false */ | ||
/* global AmCharts:true, google:true */ | ||
|
||
(function(){ | ||
'use strict'; | ||
|
||
var map; | ||
|
||
$(document).ready(function(){ | ||
var p = getPosition(); | ||
initMap(p.lat, p.lng, 7); | ||
addMarker(p.lat, p.lng, p.name); | ||
}); | ||
|
||
function addMarker(lat, lng, name){ | ||
var latLng = new google.maps.LatLng(lat, lng); | ||
new google.maps.Marker({map: map, position: latLng, title: name, animation: google.maps.Animation.DROP, icon: '/img/zombie.gif'}); | ||
} | ||
|
||
function getPosition(){ | ||
var pos = {}; | ||
pos.name = $('#map').attr('data-name'); | ||
pos.lat = parseFloat($('#map').attr('data-lat')); | ||
pos.lng = parseFloat($('#map').attr('data-lng')); | ||
console.log(pos); | ||
return pos; | ||
} | ||
|
||
function initMap(lat, lng, zoom){ | ||
var styles = [{'featureType':'landscape','stylers':[{'hue':'#F1FF00'},{'saturation':-27.4},{'lightness':9.4},{'gamma':1}]},{'featureType':'road.highway','stylers':[{'hue':'#0099FF'},{'saturation':-20},{'lightness':36.4},{'gamma':1}]},{'featureType':'road.arterial','stylers':[{'hue':'#00FF4F'},{'saturation':0},{'lightness':0},{'gamma':1}]},{'featureType':'road.local','stylers':[{'hue':'#FFB300'},{'saturation':-38},{'lightness':11.2},{'gamma':1}]},{'featureType':'water','stylers':[{'hue':'#00B6FF'},{'saturation':4.2},{'lightness':-63.4},{'gamma':1}]},{'featureType':'poi','stylers':[{'hue':'#9FFF00'},{'saturation':0},{'lightness':0},{'gamma':1}]}], | ||
mapOptions = {center: new google.maps.LatLng(lat, lng), zoom: zoom, mapTypeId: google.maps.MapTypeId.ROADMAP, styles: styles}; | ||
map = new google.maps.Map(document.getElementById('map'), mapOptions); | ||
} | ||
|
||
})(); | ||
|
||
|
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,36 @@ | ||
extends ../shared/template | ||
block content | ||
.container-fluid | ||
.row | ||
.col-xs-6 | ||
#map(data-lat='#{vacation.lat}', data-lng='#{vacation.lng}', data-name='#{vacation.name}', style='height:300px;') | ||
.col-xs-6 | ||
.row | ||
.row | ||
.col-xs-12 | ||
h3= vacation.name | ||
.row | ||
.col-xs-12 | ||
table.table | ||
tbody | ||
tr | ||
td= moment(vacation.startDate).format('MMM Do YY') | ||
td -------> | ||
td= moment(vacation.endDate).format('MMM Do YY') | ||
.row | ||
.col-xs-12 | ||
form.form-horizontal(role='form', method='post', action='/vacations') | ||
.form-group | ||
label.col-sm-2.control-label(for='url') Image URL: | ||
.col-sm-10 | ||
input.form-control#name(type='text', name='url', placeholder='http://image.com/photo.jpg') | ||
.form-group | ||
.col-sm-offset-2.col-sm-10 | ||
button.btn.btn-default(type='submit') Add Image | ||
.row | ||
.col-xs-12 | ||
h3 Photos Go Here | ||
|
||
block scripts | ||
script(src='/js/user/vacation-show.js') | ||
|
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