Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

"$msg"

  • Loading branch information...
commit 6c886d1117f85c341c108cfb667c9078dfa315ea 2 parents 6e55a02 + 4fdc484
robengel authored
View
41 geocamCover/static/javascripts/app.js
@@ -51,6 +51,7 @@ var isTapHold = false;
var isiPad = false;
var tapHoldTimeout;
var backIsMap = false;
+var defaultZoom = 15;
$(window).resize(function() {
pageResize();
@@ -75,7 +76,7 @@ $(document).ready(function () {
$('#map_canvas').gmap({
'center': latlng,
'mapTypeId': google.maps.MapTypeId.ROADMAP,
- 'zoom': 12,
+ 'zoom': defaultZoom,
'callback': function (map) {
globalMap = map;
$.getJSON('/geocamCover/places.json', function(data) {
@@ -129,6 +130,7 @@ $(document).ready(function () {
// This is to go back to the map when the back button is pressed.
window.onpopstate = function(event) {
+ backIsMap = false;
showMap();
}
@@ -171,7 +173,7 @@ $(document).ready(function () {
});
$("#address-form-form").submit(function(e) {
- createPlaceFromAddress();
+ searchPlace();
return false;
});
@@ -200,15 +202,32 @@ $(document).ready(function () {
});
});
-function createPlaceFromAddress() {
+function searchPlace() {
$('#map_canvas').gmap('search', { 'address': $('#address-name').val() }, function(isFound, results) {
if (isFound) {
- $('#map_canvas').gmap('getMap').panTo(results[0].geometry.location);
- var place = new Place();
- place.position = results[0].geometry.location;
- savePlace(place, 'address');
+
+ $('#address-name').val("");
+ $('#map_canvas').gmap('getMap').panTo(results[0].geometry.location);
+ $('#map_canvas').gmap('getMap').setZoom(defaultZoom);
+ // var place = new Place();
+ // place.position = results[0].geometry.location;
+ // savePlace(place, 'address');
+ $("#map_canvas").gmap('addMarker', {
+ 'position': results[0].geometry.location,
+ 'title': $('#address-name').val()
+ }, function(map, marker) {
+ myMarker = marker;
+ });
+
+ $(myMarker).click(function() {
+ // WTF? Why is $(this) an array?
+ clickedPosition = $(this)[0].position;
+ showPage('#place-form');
+ });
+
+ showMap();
} else {
- alert("not found"); //Need another way to display to the user that the address wasn't found
+ alert("Location Not Found."); //Need another way to display to the user that the address wasn't found
}
});
}
@@ -609,6 +628,12 @@ function handleGeolocationQuery(position) {
}, function(map, marker) {
myMarker = marker;
});
+
+ $(myMarker).click(function() {
+ clickedPosition = myLocation;
+ showPage('#place-form');
+ });
+
$('#map_canvas').gmap({
'center': myLocation
});
View
21 geocamCover/static/javascripts/jquery.ui.map.min.js 100755 → 100644
@@ -2,23 +2,6 @@
* jQuery UI Google Map 2.0
* http://code.google.com/p/jquery-ui-map/
* Copyright (c) 2010 - 2011 Johan Säll Larsson
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
+ * Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
*/
-eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(6($){y.1w.x({1k:6(4){f 3.t(\'1k\',4)},1e:6(4){f 3.t(\'1e\',4)},1h:6(4){f 3.t(\'1h\',4)},1d:6(4){f 3.t(\'1d\',4)},1j:6(4){f 3.t(\'1j\',4)},1m:6(4){f 3.t(\'1m\',4)},1n:6(4){f 3.t(\'1n\',4)},1J:6(q){b.c.G.1I(3.P(0),q)},t:6(q,4){g(3.P(0)V b.c.1H){b.c.G.1G(3.P(0),q,4)}A{3.1E(q,4)}f 3}});$.1F("9.8",{K:{1L:h,1R:n b.c.1S(0.0,0.0),1Q:z,1P:z,1C:B,1N:h,1O:h,1T:B,1r:B,1q:h,1p:b.c.1t.1B,1u:B,1x:h,1v:z,1z:z,1y:h,1A:z,1o:B,1K:h,20:5,4:h},2h:6(){$.9.8.e[3.k.l(\'d\')]={p:n b.c.2i(3.k[0],3.K),Y:[],v:h,a:[]}},2g:6(){$.9.8.w(3.K.4,3.o());f $(3.o())},14:6(2f,S){$.1g.U.14.11(3,1a);3.o().2d(3.K)},19:6(16){u e=$.9.8.e[3.k.l(\'d\')];g(!e.v){e.v=n b.c.2e()}e.v.x(16);e.p.2j(e.v)},1U:6(E,15){3.o().2p[15].17($.9.8.T(E))},2q:6(j,4){u s=n b.c.2r(y.x({\'p\':3.o(),\'v\':z},j));3.O().17(s);g(s.v){3.19(s.2l())}$.9.8.w(4,3.o(),s);f $(s)},2m:6(j,4){u R=n b.c.2c(j);$.9.8.w(4,R);f $(R)},2b:6(H,j,4){u 7=$.9.8.e[3.k.l(\'d\')];g(!7.a.M){7.a.M=n b.c.M()}g(!7.a.F){7.a.F=n b.c.F(y.x({\'p\':7.p},j))}7.a.M.21(H,6(C,D){g(D===b.c.13.Q){g(j.E){7.a.F.1Z(C)}}A{7.a.F.X(h)}$.9.8.w(4,(D===b.c.13.Q),C)})},1Y:6(E,j){u 7=$.9.8.e[3.k.l(\'d\')];g(!7.a.L){7.a.L=n b.c.L($.9.8.T(E),j)}7.p.1V(7.a.L)},1X:6(Z,S,4){$.W(3.O(),6(i,s){$.9.8.w(4,(s[Z]===S),s)})},23:6(q,I,4){g(q===\'10\'){$.9.8.10(I,4)}A g(q===\'12\'){$.9.8.12(I,4)}A g(q===\'18\'){$.9.8.18(I,4)}},2a:6(d,j){u 7=$.9.8.e[3.k.l(\'d\')];g(!7.a.N){7.a.N=n b.c.N(d,j)}7.a.N.X(3.o())},27:6(d,1l,j){u 7=$.9.8.e[3.k.l(\'d\')];g(!7.a[d])7.a[d]=n b.c.24(1l,y.x({\'p\':7.p},j))},26:6(H,4){u 7=$.9.8.e[3.k.l(\'d\')];g(!7.a.J){7.a.J=n b.c.J()}7.a.J.28(H,6(C,D){$.9.8.w(4,(D===b.c.2o.Q),C)})},o:6(){f $.9.8.e[3.k.l(\'d\')].p},O:6(){f $.9.8.e[3.k.l(\'d\')].Y},2k:6(d){f $.9.8.e[3.k.l(\'d\')].a[d]},1f:6(){$.W(3.O(),6(i,m){b.c.G.1i(m);m.X(h);m=h});$.9.8.e[3.k.l(\'d\')].Y=[]},1c:6(){3.1f();b.c.G.1i(3.o());$.W($.9.8.e[3.k.l(\'d\')].a,6(i,r){r=h});$.1g.U.1c.1b(3)}});$.x($.9.8,{25:"2.0",e:[],w:6(4){g($.29(4)){4.11(3,22.U.1W.1b(1a,1))}},T:6 2n(r){g(!r){f h}A g(r V y){f r[0]}A g(r V 1s){f r}f 1D.1M(r)}})}(y));',62,152,'|||this|callback||function|instance|gmap|ui|services|google|maps|id|instances|return|if|null||opts|element|attr||new|getMap|map|type|obj|marker|addEventListener|var|bounds|_trigger|extend|jQuery|false|else|true|result|status|panel|DirectionsRenderer|event|request|ns|Geocoder|options|StreetViewPanorama|DirectionsService|FusionTablesLayer|getMarkers|get|OK|iw|value|_unwrap|prototype|instanceof|each|setMap|markers|property|rdfa|apply|microformat|DirectionsStatus|_setOption|position|latLng|push|microdata|addBounds|arguments|call|destroy|mouseover|rightclick|clearMarkers|Widget|dblclick|clearInstanceListeners|mouseout|click|url|drag|dragend|streetViewControl|mapTypeId|mapTypeControlOptions|mapTypeControl|Object|MapTypeId|navigationControl|noClear|fn|navigationControlOptions|scaleControlOptions|scaleControl|scrollwheel|ROADMAP|draggable|document|bind|widget|addListener|MVCObject|trigger|triggerEvent|streetViewControlOptions|backgroundColor|getElementById|draggableCursor|draggingCursor|disableDoubleClickZoom|disableDefaultUI|center|LatLng|keyboardShortcuts|addControl|setStreetView|slice|findMarker|displayStreetView|setDirections|zoom|route|Array|loadMetadata|KmlLayer|version|search|loadKML|geocode|isFunction|loadFusion|displayDirections|InfoWindow|setOptions|LatLngBounds|key|_init|_create|Map|fitBounds|getService|getPosition|addInfoWindow|unwrap|GeocoderStatus|controls|addMarker|Marker'.split('|'),0,{}))
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(4($){z.1B.y({16:4(a){g 3.s(\'16\',a)},1b:4(a){g 3.s(\'1b\',a)},19:4(a){g 3.s(\'19\',a)},17:4(a){g 3.s(\'17\',a)},1c:4(a){g 3.s(\'1c\',a)},1d:4(a){g 3.s(\'1d\',a)},1i:4(a){g 3.s(\'1i\',a)},1C:4(a){9.d.G.1D(3.K(0),a)},s:4(a,b){h(9.d&&3.K(0)Q 9.d.1A){9.d.G.1z(3.K(0),a,b)}w{3.1w(a,b)}g 3}});$.1x("8.7",{u:{1y:j,1f:(9.d)?o 9.d.1E(0.0,0.0):j,1F:x,1u:x,1M:C,1N:j,1K:j,1J:C,1G:C,1H:j,13:(9.d)?9.d.1I.1O:j,1n:C,1j:j,1k:x,1l:x,1t:j,1r:x,1m:C,1p:j,15:5,1g:j},1o:4(){$.8.7.f[3.m.n(\'k\')]={l:o 9.d.1s(3.m[0],3.u),O:[],v:j,e:[]}},1L:4(){$.8.7.t(3.u.1g,3.r());g $(3.r())},U:4(a,b){q l=3.r();3.u.1f=l.1W();3.u.13=l.2d();3.u.15=l.2c();$.18.T.U.1h(3,14);l.N(3.u)},10:4(a){q f=$.8.7.f[3.m.n(\'k\')];h(!f.v){f.v=o 9.d.28()}f.v.y(a);f.l.1P(f.v)},29:4(a,b){3.r().2a[b].11($.8.7.S(a))},2f:4(a,b){q p=o 9.d.2g(z.y({\'l\':3.r(),\'v\':x},a));3.F().11(p);h(p.v){3.10(p.2l())}$.8.7.t(b,3.r(),p);g $(p)},2k:4(a,b){q L=o 9.d.2j(a);$.8.7.t(b,L);g $(L)},2i:4(a,b,c){q 6=$.8.7.f[3.m.n(\'k\')];h(!6.e.I){6.e.I=o 9.d.I()}h(!6.e.A){6.e.A=o 9.d.A()}6.e.A.N(z.y({\'l\':6.l},b));6.e.I.27(a,4(D,B){h(B===9.d.12.M){h(b.26){6.e.A.1V(D)}}w{6.e.A.J(j)}$.8.7.t(c,(B===9.d.12.M),D)})},1U:4(a,b){q 6=$.8.7.f[3.m.n(\'k\')];6.e.P=o 9.d.P($.8.7.S(a),b);6.l.1T(6.e.P)},1Q:4(a,b,c){$.R(3.F(),4(i,p){$.8.7.t(c,(p[a]===b),p)})},1S:4(a,b,c){h(a===\'V\'){$.8.7.V(b,c)}w h(a===\'W\'){$.8.7.W(b,c)}w h(a===\'X\'){$.8.7.X(b,c)}},1X:4(a){q 6=$.8.7.f[3.m.n(\'k\')];h(!6.e.E){6.e.E=o 9.d.E()}6.e.E.N(a);6.e.E.J(3.r())},24:4(a,b,c){q 6=$.8.7.f[3.m.n(\'k\')];h(!6.e[a])6.e[a]=o 9.d.25(b,z.y({\'l\':6.l},c))},1Z:4(a,b){q 6=$.8.7.f[3.m.n(\'k\')];h(!6.e.H){6.e.H=o 9.d.H()}6.e.H.22(a,4(D,B){$.8.7.t(b,(B===9.d.1R.M),D)})},r:4(){g $.8.7.f[3.m.n(\'k\')].l},F:4(){g $.8.7.f[3.m.n(\'k\')].O},2e:4(k){g $.8.7.f[3.m.n(\'k\')].e[k]},Z:4(){$.R(3.F(),4(a,b){9.d.G.1e(b);b.J(j);b=j});$.8.7.f[3.m.n(\'k\')].O=[]},1a:4(){3.Z();9.d.G.1e(3.r());$.R($.8.7.f[3.m.n(\'k\')].e,4(a,b){b=j});$.18.T.1a.Y(3)}});$.y($.8.7,{23:"2.0",f:[],t:4(a){h($.21(a)){a.1h(3,20.T.1Y.Y(14,1))}},S:4 2h(a){h(!a){g j}w h(a Q z){g a[0]}w h(a Q 2b){g a}g 1q.1v(a)}})}(z));',62,146,'|||this|function||instance|gmap|ui|google||||maps|services|instances|return|if||null|id|map|element|attr|new|marker|var|getMap|addEventListener|_trigger|options|bounds|else|false|extend|jQuery|DirectionsRenderer|status|true|result|FusionTablesLayer|getMarkers|event|Geocoder|DirectionsService|setMap|get|iw|OK|setOptions|markers|StreetViewPanorama|instanceof|each|_unwrap|prototype|_setOption|rdfa|microformat|microdata|call|clearMarkers|addBounds|push|DirectionsStatus|mapTypeId|arguments|zoom|click|mouseover|Widget|dblclick|destroy|rightclick|mouseout|drag|clearInstanceListeners|center|callback|apply|dragend|navigationControlOptions|noClear|scaleControl|streetViewControl|navigationControl|_create|streetViewControlOptions|document|scrollwheel|Map|scaleControlOptions|disableDoubleClickZoom|getElementById|bind|widget|backgroundColor|addListener|MVCObject|fn|triggerEvent|trigger|LatLng|disableDefaultUI|mapTypeControl|mapTypeControlOptions|MapTypeId|keyboardShortcuts|draggingCursor|_init|draggable|draggableCursor|ROADMAP|fitBounds|findMarker|GeocoderStatus|loadMetadata|setStreetView|displayStreetView|setDirections|getCenter|loadFusion|slice|search|Array|isFunction|geocode|version|loadKML|KmlLayer|panel|route|LatLngBounds|addControl|controls|Object|getZoom|getMapTypeId|getService|addMarker|Marker|unwrap|displayDirections|InfoWindow|addInfoWindow|getPosition'.split('|'),0,{}))
View
7 geocamCover/templates/geocamCover/index.html
@@ -45,10 +45,9 @@ <h1 class='ui-title' style="margin-left: 0px;margin-right: 0px;">GeoCam Cover</h
<h1 class='ui-title' style="margin-left: 0px;margin-right: 0px;">Add Place</h1>
</div>
<form id="address-form-form">
- <h1 class="page-h1">Please enter an address:</h1>
- <input style='width:95%' id="address-name" type="text" placeholder="Enter Address..."/>
- <select id="address-categories-select" class="categories"></select>
- <input class="submit-button big-button" type="submit" value="Add Place"/>
+ <h1 class="page-h1">Search By Location</h1>
+ <input style='width:95%' id="address-name" type="text" placeholder="Address or location name"/>
+ <input class="submit-button big-button" type="submit" value="Search for Place"/>
<input class="big-button" type="button" value="Back to Map" onclick="showMap();"/>
</form>
<input class="big-button" type="button" value="Load Fusion Table" onclick="loadFusionData();"/>
Please sign in to comment.
Something went wrong with that request. Please try again.