geofsh 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  module Geofsh
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -1,55 +1,57 @@
1
- var geolocError, addMarker, getPosition, hideAddressAndZip, hideGeoLoc, geolocSuccess, googleMap, mapOptions, map, marker, geolat, geolng, geoCoords;
2
-
3
- googleMap = function(geolat, geolng) {
4
- if(document.getElementById("google-map")){
5
- geoCoords = new google.maps.LatLng(geolat, geolng);
6
- mapOptions = {
7
- zoom: 16,
8
- center: geoCoords,
9
- mapTypeId: google.maps.MapTypeId.ROADMAP
10
- };
11
-
12
- map = new google.maps.Map(document.getElementById("google-map"), mapOptions);
13
- addMarker(geoCoords, "You are here!");
1
+ (function(){
2
+ var geolocError, addMarker, getPosition, hideAddressAndZip, hideGeoLoc, geolocSuccess, googleMap, mapOptions, map, marker, geolat, geolng, geoCoords;
3
+
4
+ googleMap = function(geolat, geolng) {
5
+ if(document.getElementById("google-map")){
6
+ geoCoords = new google.maps.LatLng(geolat, geolng);
7
+ mapOptions = {
8
+ zoom: 16,
9
+ center: geoCoords,
10
+ mapTypeId: google.maps.MapTypeId.ROADMAP
11
+ };
12
+
13
+ map = new google.maps.Map(document.getElementById("google-map"), mapOptions);
14
+ addMarker(geoCoords, "You are here!");
15
+ }
16
+ };
17
+
18
+ addMarker = function(position, title) {
19
+ marker = new google.maps.Marker({
20
+ position: position,
21
+ map: map,
22
+ title: title
23
+ });
14
24
  }
15
- };
16
-
17
- addMarker = function(position, title) {
18
- marker = new google.maps.Marker({
19
- position: position,
20
- map: map,
21
- title: title
22
- });
23
- }
24
- geolocSuccess = function(position) {
25
- geolat = position.coords.latitude;
26
- geolng = position.coords.longitude;
27
- $('input#latitude').val(geolat);
28
- $('input#longitude').val(geolng);
29
- return googleMap(geolat, geolng);
30
- };
31
-
32
- geolocError = function() {
33
- hideGeoLoc();
34
- return "Geolocation Unsuccessful";
35
- };
36
-
37
-
38
- hideGeoLoc = function() {
39
- return $('.geoloc-hide').parent().hide();
40
- };
41
-
42
- getPosition = function() {
43
- if (navigator.geolocation) {
44
- return navigator.geolocation.getCurrentPosition(geolocSuccess, geolocError);
45
- } else {
46
- hideGeoLoc();
47
- return "Geolocation not supported";
48
- }
49
- };
50
-
51
-
52
- $(function() {
53
- return getPosition();
54
- });
25
+ geolocSuccess = function(position) {
26
+ geolat = position.coords.latitude;
27
+ geolng = position.coords.longitude;
28
+ $('input#latitude').val(geolat);
29
+ $('input#longitude').val(geolng);
30
+ return googleMap(geolat, geolng);
31
+ };
32
+
33
+ geolocError = function() {
34
+ hideGeoLoc();
35
+ return "Geolocation Unsuccessful";
36
+ };
37
+
38
+
39
+ hideGeoLoc = function() {
40
+ return $('.geoloc-hide').parent().hide();
41
+ };
42
+
43
+ getPosition = function() {
44
+ if (navigator.geolocation) {
45
+ return navigator.geolocation.getCurrentPosition(geolocSuccess, geolocError);
46
+ } else {
47
+ hideGeoLoc();
48
+ return "Geolocation not supported";
49
+ }
50
+ };
51
+
52
+
53
+ $(function() {
54
+ return getPosition();
55
+ })
56
+ }).call(this);
55
57
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geofsh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -106,7 +106,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
106
106
  version: '0'
107
107
  segments:
108
108
  - 0
109
- hash: 3450935956358020349
109
+ hash: 225897693785589626
110
110
  required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  none: false
112
112
  requirements:
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  version: '0'
116
116
  segments:
117
117
  - 0
118
- hash: 3450935956358020349
118
+ hash: 225897693785589626
119
119
  requirements: []
120
120
  rubyforge_project:
121
121
  rubygems_version: 1.8.24