gmapsjs 0.1.9 → 0.1.10

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.
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # Gmapsjs
2
2
 
3
- TODO: Write a gem description
3
+ gmaps.js allows you to use the potential of Google Maps in a simple way.
4
+ No more extensive documentation or large amount of code.
5
+
6
+ GmapsJS, the gem, bundles gmap.js in a easy to use Rails Engine compatible with the Asset Pipeline introduced in Rails 3.1.
4
7
 
5
8
  ## Installation
6
9
 
@@ -18,12 +21,8 @@ Or install it yourself as:
18
21
 
19
22
  ## Usage
20
23
 
21
- TODO: Write usage instructions here
24
+ Add the call for GmapsJS to your manifest file, like:
22
25
 
23
- ## Contributing
26
+ //= require gmapsjs
24
27
 
25
- 1. Fork it
26
- 2. Create your feature branch (`git checkout -b my-new-feature`)
27
- 3. Commit your changes (`git commit -am 'Added some feature'`)
28
- 4. Push to the branch (`git push origin my-new-feature`)
29
- 5. Create new Pull Request
28
+ Read the documentation and examples at: http://hpneo.github.com/gmaps/
@@ -8,6 +8,7 @@ var GMaps = (function($) {
8
8
  window.context_menu = {};
9
9
 
10
10
  this.div = $(options.div)[0];
11
+ this.controls = [];
11
12
  this.overlays = [];
12
13
  this.markers = [];
13
14
  this.polylines = [];
@@ -241,6 +242,41 @@ var GMaps = (function($) {
241
242
  this.map.setZoom(this.map.getZoom() - value);
242
243
  };
243
244
 
245
+ this.createControl = function(options) {
246
+ options.style.cursor = 'pointer';
247
+ options.style.fontFamily = 'Arial, sans-serif';
248
+ options.style.fontSize = '13px';
249
+ options.style.boxShadow = 'rgba(0, 0, 0, 0.398438) 0px 2px 4px';
250
+
251
+ var controlDiv = $('<div></div>');
252
+ controlDiv.css(options.style);
253
+ controlDiv.text(options.text);
254
+
255
+ var control = controlDiv[0];
256
+
257
+ for(var e in options.events) {
258
+ google.maps.event.addDomListener(control, e, function() {
259
+ options.events[e].apply(this, [this]);
260
+ });
261
+ }
262
+
263
+ control.index = 1;
264
+
265
+ return control;
266
+ };
267
+
268
+ this.addControl = function(options) {
269
+ var position = google.maps.ControlPosition[options.position.toUpperCase()];
270
+
271
+ delete options.position;
272
+
273
+ var control = this.createControl(options);
274
+ this.controls.push(control);
275
+ this.map.controls[position].push(control);
276
+
277
+ return control;
278
+ };
279
+
244
280
  // Markers
245
281
  this.createMarker = function(options) {
246
282
  if (options.lat && options.lng) {
@@ -1,3 +1,3 @@
1
1
  module GmapsJS
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.10"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gmapsjs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-05-17 00:00:00.000000000Z
13
+ date: 2012-05-27 00:00:00.000000000Z
14
14
  dependencies: []
15
15
  description: ! 'gmaps.js allows you to use the potential of Google Maps in a simple
16
16
  way.