gmaps4rails 0.11.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +6 -2
- data/app/views/gmaps4rails/_gmaps4rails.html.erb +18 -20
- data/lib/gmaps4rails/base.rb +95 -0
- data/lib/gmaps4rails/extensions/hash.rb +3 -67
- data/lib/gmaps4rails/helper/gmaps4rails_helper.rb +13 -2
- data/public/javascripts/gmaps4rails/all_apis.js +5 -0
- data/public/javascripts/gmaps4rails/gmaps4rails.base.js +147 -112
- data/public/javascripts/gmaps4rails/gmaps4rails.bing.js +182 -171
- data/public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js +269 -235
- data/public/javascripts/gmaps4rails/gmaps4rails.mapquest.js +135 -125
- data/public/javascripts/gmaps4rails/gmaps4rails.openlayers.js +227 -218
- data/public/stylesheets/gmaps4rails.css +2 -2
- metadata +9 -111
- data/test/dummy/app/controllers/application_controller.rb +0 -3
- data/test/dummy/app/controllers/users_controller.rb +0 -60
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/helpers/users_helper.rb +0 -3
- data/test/dummy/app/models/user.rb +0 -38
- data/test/dummy/config/application.rb +0 -41
- data/test/dummy/config/boot.rb +0 -6
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -26
- data/test/dummy/config/environments/production.rb +0 -49
- data/test/dummy/config/environments/test.rb +0 -35
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/inflections.rb +0 -10
- data/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test/dummy/config/initializers/secret_token.rb +0 -7
- data/test/dummy/config/initializers/session_store.rb +0 -8
- data/test/dummy/config/routes.rb +0 -7
- data/test/dummy/db/migrate/20110306182914_create_users.rb +0 -21
- data/test/dummy/db/migrate/20110430081624_add_addresses_to_users.rb +0 -11
- data/test/dummy/db/migrate/20110430083824_remove_address_from_users.rb +0 -9
- data/test/dummy/db/schema.rb +0 -35
- data/test/dummy/db/seeds.rb +0 -7
- data/test/dummy/spec/base/base_spec.rb +0 -127
- data/test/dummy/spec/helpers/gmaps4rails_helper_spec.rb +0 -13
- data/test/dummy/spec/javascripts/support/jasmine_config.rb +0 -23
- data/test/dummy/spec/javascripts/support/jasmine_runner.rb +0 -20
- data/test/dummy/spec/models/user_spec.rb +0 -284
- data/test/dummy/spec/requests/users_spec.rb +0 -22
- data/test/dummy/spec/spec_helper.rb +0 -41
- data/test/dummy/spec/support/factories.rb +0 -20
- data/test/dummy/spec/support/matchers.rb +0 -7
- data/test/dummy31/app/controllers/application_controller.rb +0 -3
- data/test/dummy31/app/controllers/users_controller.rb +0 -83
- data/test/dummy31/app/helpers/application_helper.rb +0 -2
- data/test/dummy31/app/helpers/users_helper.rb +0 -2
- data/test/dummy31/app/models/user.rb +0 -7
- data/test/dummy31/config/application.rb +0 -43
- data/test/dummy31/config/boot.rb +0 -6
- data/test/dummy31/config/environment.rb +0 -5
- data/test/dummy31/config/environments/development.rb +0 -27
- data/test/dummy31/config/environments/production.rb +0 -51
- data/test/dummy31/config/environments/test.rb +0 -39
- data/test/dummy31/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy31/config/initializers/inflections.rb +0 -10
- data/test/dummy31/config/initializers/mime_types.rb +0 -5
- data/test/dummy31/config/initializers/secret_token.rb +0 -7
- data/test/dummy31/config/initializers/session_store.rb +0 -8
- data/test/dummy31/config/initializers/wrap_parameters.rb +0 -12
- data/test/dummy31/config/routes.rb +0 -61
- data/test/dummy31/db/migrate/20110809134019_create_users.rb +0 -13
- data/test/dummy31/db/schema.rb +0 -25
- data/test/dummy31/db/seeds.rb +0 -7
@@ -1,272 +1,306 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
//
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
1
|
+
var Gmaps4RailsGoogle = function() {
|
2
|
+
|
3
|
+
//Map settings
|
4
|
+
this.map_options = {
|
5
|
+
disableDefaultUI: false,
|
6
|
+
disableDoubleClickZoom: false,
|
7
|
+
type: "ROADMAP" // HYBRID, ROADMAP, SATELLITE, TERRAIN
|
8
|
+
};
|
9
|
+
|
10
|
+
this.mergeWithDefault("map_options");
|
11
|
+
|
12
|
+
//markers + info styling
|
13
|
+
this.markers_conf = {
|
14
|
+
clusterer_gridSize: 50,
|
15
|
+
clusterer_maxZoom: 5,
|
16
|
+
custom_cluster_pictures: null,
|
17
|
+
custom_infowindow_class: null
|
18
|
+
};
|
19
|
+
|
20
|
+
this.mergeWithDefault("markers_conf");
|
21
|
+
|
22
|
+
this.kml_options = {
|
23
|
+
clickable: true,
|
24
|
+
preserveViewport: false,
|
25
|
+
suppressInfoWindows: false
|
26
|
+
};
|
27
|
+
|
28
|
+
//Polygon Styling
|
29
|
+
this.polygons_conf = { // default style for polygons
|
30
|
+
strokeColor: "#FFAA00",
|
31
|
+
strokeOpacity: 0.8,
|
32
|
+
strokeWeight: 2,
|
33
|
+
fillColor: "#000000",
|
34
|
+
fillOpacity: 0.35
|
35
|
+
};
|
20
36
|
|
21
|
-
//Polyline Styling
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
};
|
37
|
+
//Polyline Styling
|
38
|
+
this.polylines_conf = { //default style for polylines
|
39
|
+
strokeColor: "#FF0000",
|
40
|
+
strokeOpacity: 1,
|
41
|
+
strokeWeight: 2
|
42
|
+
};
|
27
43
|
|
28
|
-
//Circle Styling
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
};
|
44
|
+
//Circle Styling
|
45
|
+
this.circles_conf = { //default style for circles
|
46
|
+
fillColor: "#00AAFF",
|
47
|
+
fillOpacity: 0.35,
|
48
|
+
strokeColor: "#FFAA00",
|
49
|
+
strokeOpacity: 0.8,
|
50
|
+
strokeWeight: 2,
|
51
|
+
clickable: false,
|
52
|
+
zIndex: null
|
53
|
+
};
|
38
54
|
|
39
|
-
//Direction Settings
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
};
|
55
|
+
//Direction Settings
|
56
|
+
this.direction_conf = {
|
57
|
+
panel_id: null,
|
58
|
+
display_panel: false,
|
59
|
+
origin: null,
|
60
|
+
destination: null,
|
61
|
+
waypoints: [], //[{location: "toulouse,fr", stopover: true}, {location: "Clermont-Ferrand, fr", stopover: true}]
|
62
|
+
optimizeWaypoints: false,
|
63
|
+
unitSystem: "METRIC", //IMPERIAL
|
64
|
+
avoidHighways: false,
|
65
|
+
avoidTolls: false,
|
66
|
+
region: null,
|
67
|
+
travelMode: "DRIVING" //WALKING, BICYCLING
|
68
|
+
};
|
53
69
|
|
54
|
-
////////////////////////////////////////////////////
|
55
|
-
/////////////// Basic Objects //////////////
|
56
|
-
////////////////////////////////////////////////////
|
70
|
+
////////////////////////////////////////////////////
|
71
|
+
/////////////// Basic Objects //////////////
|
72
|
+
////////////////////////////////////////////////////
|
57
73
|
|
58
|
-
|
59
|
-
|
60
|
-
};
|
74
|
+
this.createPoint = function(lat, lng){
|
75
|
+
return new google.maps.Point(lat, lng);
|
76
|
+
};
|
61
77
|
|
62
|
-
|
63
|
-
|
64
|
-
};
|
78
|
+
this.createLatLng = function(lat, lng){
|
79
|
+
return new google.maps.LatLng(lat, lng);
|
80
|
+
};
|
65
81
|
|
66
|
-
|
67
|
-
|
68
|
-
};
|
82
|
+
this.createLatLngBounds = function(){
|
83
|
+
return new google.maps.LatLngBounds();
|
84
|
+
};
|
69
85
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
};
|
86
|
+
this.createMap = function(){
|
87
|
+
return new google.maps.Map(document.getElementById(this.map_options.id), {
|
88
|
+
maxZoom: this.map_options.maxZoom,
|
89
|
+
minZoom: this.map_options.minZoom,
|
90
|
+
zoom: this.map_options.zoom,
|
91
|
+
center: this.createLatLng(this.map_options.center_latitude, this.map_options.center_longitude),
|
92
|
+
mapTypeId: google.maps.MapTypeId[this.map_options.type],
|
93
|
+
mapTypeControl: this.map_options.mapTypeControl,
|
94
|
+
disableDefaultUI: this.map_options.disableDefaultUI,
|
95
|
+
disableDoubleClickZoom: this.map_options.disableDoubleClickZoom,
|
96
|
+
draggable: this.map_options.draggable
|
97
|
+
});
|
98
|
+
};
|
83
99
|
|
84
|
-
|
85
|
-
|
86
|
-
};
|
100
|
+
this.createMarkerImage = function(markerPicture, markerSize, origin, anchor, scaledSize) {
|
101
|
+
return new google.maps.MarkerImage(markerPicture, markerSize, origin, anchor, scaledSize);
|
102
|
+
};
|
87
103
|
|
88
104
|
|
89
|
-
|
90
|
-
|
91
|
-
};
|
105
|
+
this.createSize = function(width, height){
|
106
|
+
return new google.maps.Size(width, height);
|
107
|
+
};
|
92
108
|
|
93
|
-
////////////////////////////////////////////////////
|
94
|
-
////////////////////// Markers /////////////////////
|
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
|
-
};
|
109
|
+
////////////////////////////////////////////////////
|
110
|
+
////////////////////// Markers /////////////////////
|
111
|
+
////////////////////////////////////////////////////
|
112
|
+
|
113
|
+
this.createMarker = function(args){
|
114
|
+
var markerLatLng = this.createLatLng(args.Lat, args.Lng);
|
115
|
+
|
116
|
+
// Marker sizes are expressed as a Size of X,Y
|
117
|
+
if (args.marker_picture === "" && args.rich_marker === null) {
|
118
|
+
return new google.maps.Marker({position: markerLatLng, map: this.map, title: args.marker_title, draggable: args.marker_draggable});
|
119
|
+
}
|
120
|
+
else if (args.rich_marker !== null){
|
121
|
+
return new RichMarker({position: markerLatLng,
|
122
|
+
map: this.map,
|
123
|
+
draggable: args.marker_draggable,
|
124
|
+
content: args.rich_marker,
|
125
|
+
flat: args.marker_anchor === null ? false : args.marker_anchor[1],
|
126
|
+
anchor: args.marker_anchor === null ? 0 : args.marker_anchor[0]
|
127
|
+
});
|
128
|
+
}
|
129
|
+
else {
|
130
|
+
// calculate MarkerImage anchor location
|
131
|
+
var imageAnchorPosition = this.createImageAnchorPosition(args.marker_anchor);
|
132
|
+
var shadowAnchorPosition = this.createImageAnchorPosition(args.shadow_anchor);
|
133
|
+
|
134
|
+
//create or retrieve existing MarkerImages
|
135
|
+
var markerImage = this.createOrRetrieveImage(args.marker_picture, args.marker_width, args.marker_height, imageAnchorPosition);
|
136
|
+
var shadowImage = this.createOrRetrieveImage(args.shadow_picture, args.shadow_width, args.shadow_height, shadowAnchorPosition);
|
137
|
+
return new google.maps.Marker({position: markerLatLng, map: this.map, icon: markerImage, title: args.marker_title, draggable: args.marker_draggable, shadow: shadowImage});
|
138
|
+
}
|
139
|
+
};
|
124
140
|
|
125
|
-
//checks if obj is included in arr Array and returns the position or false
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
};
|
141
|
+
//checks if obj is included in arr Array and returns the position or false
|
142
|
+
this.includeMarkerImage = function(arr, obj) {
|
143
|
+
for(var i=0; i<arr.length; i++) {
|
144
|
+
if (arr[i].url == obj) {return i;}
|
145
|
+
}
|
146
|
+
return false;
|
147
|
+
};
|
132
148
|
|
133
|
-
// checks if MarkerImage exists before creating a new one
|
134
|
-
// returns a MarkerImage or false if ever something wrong is passed as argument
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
};
|
149
|
+
// checks if MarkerImage exists before creating a new one
|
150
|
+
// returns a MarkerImage or false if ever something wrong is passed as argument
|
151
|
+
this.createOrRetrieveImage = function(currentMarkerPicture, markerWidth, markerHeight, imageAnchorPosition){
|
152
|
+
if (currentMarkerPicture === "" || currentMarkerPicture === null )
|
153
|
+
{ return null;}
|
154
|
+
|
155
|
+
var test_image_index = this.includeMarkerImage(this.markerImages, currentMarkerPicture);
|
156
|
+
switch (test_image_index)
|
157
|
+
{
|
158
|
+
case false:
|
159
|
+
var markerImage = this.createMarkerImage(currentMarkerPicture, this.createSize(markerWidth, markerHeight), null, imageAnchorPosition, null );
|
160
|
+
this.markerImages.push(markerImage);
|
161
|
+
return markerImage;
|
162
|
+
break;
|
163
|
+
default:
|
164
|
+
if (typeof test_image_index == 'number') { return this.markerImages[test_image_index]; }
|
165
|
+
else { return false; }
|
166
|
+
break;
|
167
|
+
}
|
168
|
+
};
|
153
169
|
|
154
|
-
// clear markers
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
};
|
170
|
+
// clear markers
|
171
|
+
this.clearMarkers = function() {
|
172
|
+
for (var i = 0; i < this.markers.length; ++i) {
|
173
|
+
this.clearMarker(this.markers[i]);
|
174
|
+
}
|
175
|
+
};
|
160
176
|
|
161
|
-
//show and hide markers
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
};
|
177
|
+
//show and hide markers
|
178
|
+
this.showMarkers = function() {
|
179
|
+
for (var i = 0; i < this.markers.length; ++i) {
|
180
|
+
this.showMarker(this.markers[i]);
|
181
|
+
}
|
182
|
+
};
|
167
183
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
};
|
184
|
+
this.hideMarkers = function() {
|
185
|
+
for (var i = 0; i < this.markers.length; ++i) {
|
186
|
+
this.hideMarker(this.markers[i]);
|
187
|
+
}
|
188
|
+
};
|
173
189
|
|
174
|
-
|
175
|
-
|
176
|
-
};
|
190
|
+
this.clearMarker = function(marker) {
|
191
|
+
marker.serviceObject.setMap(null);
|
192
|
+
};
|
177
193
|
|
178
|
-
|
179
|
-
|
180
|
-
};
|
194
|
+
this.showMarker = function(marker) {
|
195
|
+
marker.serviceObject.setVisible(true);
|
196
|
+
};
|
181
197
|
|
182
|
-
|
183
|
-
|
184
|
-
};
|
198
|
+
this.hideMarker = function(marker) {
|
199
|
+
marker.serviceObject.setVisible(false);
|
200
|
+
};
|
185
201
|
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
};
|
202
|
+
this.extendBoundsWithMarkers = function(){
|
203
|
+
for (var i = 0; i < this.markers.length; ++i) {
|
204
|
+
this.boundsObject.extend(this.markers[i].serviceObject.position);
|
205
|
+
}
|
206
|
+
};
|
191
207
|
|
192
|
-
////////////////////////////////////////////////////
|
193
|
-
/////////////////// Clusterer //////////////////////
|
194
|
-
////////////////////////////////////////////////////
|
208
|
+
////////////////////////////////////////////////////
|
209
|
+
/////////////////// Clusterer //////////////////////
|
210
|
+
////////////////////////////////////////////////////
|
195
211
|
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
};
|
212
|
+
this.createClusterer = function(markers_array){
|
213
|
+
return new MarkerClusterer( this.map,
|
214
|
+
markers_array,
|
215
|
+
{ maxZoom: this.markers_conf.clusterer_maxZoom, gridSize: this.markers_conf.clusterer_gridSize, styles: this.customClusterer() }
|
216
|
+
);
|
217
|
+
};
|
202
218
|
|
203
|
-
|
204
|
-
|
205
|
-
};
|
219
|
+
this.clearClusterer = function() {
|
220
|
+
this.markerClusterer.clearMarkers();
|
221
|
+
};
|
206
222
|
|
207
|
-
//creates clusters
|
208
|
-
|
209
|
-
{
|
210
|
-
if (this.markers_conf.do_clustering === true)
|
223
|
+
//creates clusters
|
224
|
+
this.clusterize = function()
|
211
225
|
{
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
markers_array
|
226
|
+
if (this.markers_conf.do_clustering === true)
|
227
|
+
{
|
228
|
+
//first clear the existing clusterer if any
|
229
|
+
if (this.markerClusterer !== null) {
|
230
|
+
this.clearClusterer();
|
231
|
+
}
|
232
|
+
|
233
|
+
var markers_array = new Array;
|
234
|
+
for (var i = 0; i < this.markers.length; ++i) {
|
235
|
+
markers_array.push(this.markers[i].serviceObject);
|
236
|
+
}
|
237
|
+
|
238
|
+
this.markerClusterer = this.createClusterer(markers_array);
|
220
239
|
}
|
240
|
+
};
|
221
241
|
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
//
|
231
|
-
|
232
|
-
|
233
|
-
if (this.markers_conf.custom_infowindow_class === null && Gmaps4Rails.exists(marker_container.description)) {
|
234
|
-
//create the infowindow
|
235
|
-
info_window = new google.maps.InfoWindow({content: marker_container.description });
|
236
|
-
//add the listener associated
|
237
|
-
google.maps.event.addListener(marker_container.serviceObject, 'click', this.openInfoWindow(info_window, marker_container.serviceObject));
|
238
|
-
}
|
239
|
-
else { //creating custom infowindow
|
240
|
-
if (this.exists(marker_container.description)) {
|
241
|
-
var boxText = document.createElement("div");
|
242
|
-
boxText.setAttribute("class", this.markers_conf.custom_infowindow_class); //to customize
|
243
|
-
boxText.innerHTML = marker_container.description;
|
244
|
-
info_window = new InfoBox(Gmaps4Rails.infobox(boxText));
|
242
|
+
////////////////////////////////////////////////////
|
243
|
+
/////////////////// INFO WINDOW ////////////////////
|
244
|
+
////////////////////////////////////////////////////
|
245
|
+
|
246
|
+
// creates infowindows
|
247
|
+
this.createInfoWindow = function(marker_container){
|
248
|
+
var info_window;
|
249
|
+
if (this.markers_conf.custom_infowindow_class === null && this.exists(marker_container.description)) {
|
250
|
+
//create the infowindow
|
251
|
+
info_window = new google.maps.InfoWindow({content: marker_container.description });
|
252
|
+
//add the listener associated
|
245
253
|
google.maps.event.addListener(marker_container.serviceObject, 'click', this.openInfoWindow(info_window, marker_container.serviceObject));
|
246
254
|
}
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
+
else { //creating custom infowindow
|
256
|
+
if (this.exists(marker_container.description)) {
|
257
|
+
var boxText = document.createElement("div");
|
258
|
+
boxText.setAttribute("class", this.markers_conf.custom_infowindow_class); //to customize
|
259
|
+
boxText.innerHTML = marker_container.description;
|
260
|
+
info_window = new InfoBox(this.infobox(boxText));
|
261
|
+
google.maps.event.addListener(marker_container.serviceObject, 'click', this.openInfoWindow(info_window, marker_container.serviceObject));
|
262
|
+
}
|
255
263
|
}
|
264
|
+
};
|
265
|
+
|
266
|
+
this.openInfoWindow = function(infoWindow, marker) {
|
267
|
+
return function() {
|
268
|
+
// Close the latest selected marker before opening the current one.
|
269
|
+
if (this.visibleInfoWindow) {
|
270
|
+
this.visibleInfoWindow.close();
|
271
|
+
}
|
256
272
|
|
257
|
-
|
258
|
-
|
273
|
+
infoWindow.open(this.map, marker);
|
274
|
+
this.visibleInfoWindow = infoWindow;
|
275
|
+
};
|
276
|
+
};
|
277
|
+
|
278
|
+
////////////////////////////////////////////////////
|
279
|
+
///////////////// KML //////////////////
|
280
|
+
////////////////////////////////////////////////////
|
281
|
+
|
282
|
+
this.createKmlLayer = function(kml){
|
283
|
+
var kml_options = kml.options || {};
|
284
|
+
kml_options = this.mergeObjectWithDefault(kml_options, this.kml_options);
|
285
|
+
var kml = new google.maps.KmlLayer( kml.url,
|
286
|
+
kml_options
|
287
|
+
);
|
288
|
+
kml.setMap(this.map);
|
289
|
+
return kml;
|
259
290
|
};
|
260
|
-
};
|
261
291
|
|
262
|
-
////////////////////////////////////////////////////
|
263
|
-
/////////////////// Other methods //////////////////
|
264
|
-
////////////////////////////////////////////////////
|
265
292
|
|
266
|
-
|
267
|
-
|
293
|
+
////////////////////////////////////////////////////
|
294
|
+
/////////////////// Other methods //////////////////
|
295
|
+
////////////////////////////////////////////////////
|
296
|
+
|
297
|
+
this.fitBounds = function(){
|
298
|
+
this.map.fitBounds(this.boundsObject);
|
299
|
+
};
|
300
|
+
|
301
|
+
this.centerMapOnUser = function(){
|
302
|
+
this.map.setCenter(this.userLocation);
|
303
|
+
};
|
268
304
|
};
|
269
305
|
|
270
|
-
|
271
|
-
Gmaps4Rails.map.setCenter(Gmaps4Rails.userLocation);
|
272
|
-
};
|
306
|
+
Gmaps4RailsGoogle.prototype = new Gmaps4Rails();
|