scrivito_google_maps_widget 0.1.5 → 0.1.6
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.
- checksums.yaml +4 -4
- data/README.md +10 -53
- data/app/assets/javascripts/scrivito_google_maps_widget/application.js.coffee +1 -2
- data/app/assets/stylesheets/scrivito_google_maps_widget/editing.css +0 -1
- data/app/models/google_maps_widget.rb +1 -0
- data/app/views/google_maps_widget/details.html.erb +9 -5
- data/app/views/google_maps_widget/show.html.erb +2 -2
- data/lib/scrivito_google_maps_widget/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: df16f2d97b5824af6a5da28457b5eb6650a16772
|
|
4
|
+
data.tar.gz: 75b8e919b1943d64eacd143f76b04fbd7d0e25f4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1c98f1e1255c609bf2ad084eb4aada6895b01574f58b80d33791b2acc74acaa390beb80f114d42f288a1bdf7ba716c25bf91ee7de5f3bc4f4ca9c228b1a5c118
|
|
7
|
+
data.tar.gz: ca8645728bb315c3e93b417459c21b01e04849d1d5c97493877d964970dd56541776be1d537fa0bbb578619966355c72426776833e5472ff0fac248d050367eb
|
data/README.md
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ScrivitoGoogleMapsWidget
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[](https://codeclimate.com/github/Scrivito/scrivito_google_maps_widget)
|
|
5
|
-
[](https://gemnasium.com/Scrivito/scrivito_google_maps_widget)
|
|
6
|
-
|
|
7
|
-
The google maps widget is based on the
|
|
3
|
+
The Google Maps widget is based on the
|
|
8
4
|
[Google Places JavaScript API](https://developers.google.com/maps/documentation/javascript/places).
|
|
9
|
-
It displays a single location marker for an
|
|
10
|
-
input field with location suggestions.
|
|
5
|
+
It displays a single location marker for an address that can be specified using an input field supporting location suggestions.
|
|
11
6
|
|
|
12
7
|
## Installation
|
|
13
8
|
|
|
@@ -15,56 +10,18 @@ Add this line to your application's `Gemfile`:
|
|
|
15
10
|
|
|
16
11
|
gem 'scrivito_google_maps_widget'
|
|
17
12
|
|
|
18
|
-
Include the Google Maps Places JavaScript library in your application
|
|
19
|
-
Do not forget to add this load this line in your scrivito_dialog view.
|
|
13
|
+
Include the Google Maps Places JavaScript library in your application.html.erb:
|
|
20
14
|
|
|
21
15
|
javascript_include_tag('//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places')
|
|
22
16
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
//= require google_maps_widget/application
|
|
26
|
-
|
|
27
|
-
Add this line to your editing JavaScript manifest:
|
|
28
|
-
|
|
29
|
-
//= require google_maps_widget/editing
|
|
30
|
-
|
|
31
|
-
Add this line to your application Stylesheet manifest:
|
|
32
|
-
|
|
33
|
-
*= require google_maps_widget/application
|
|
34
|
-
|
|
35
|
-
Add this line to your editing Stylesheet manifest:
|
|
36
|
-
|
|
37
|
-
*= require google_maps_widget/editing
|
|
17
|
+
Include the Google Maps Places JavaScript library in your scrivito_dialog.html.erb:
|
|
38
18
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
$ bundle
|
|
42
|
-
$ rake scrivito:migrate:install
|
|
43
|
-
$ rake scrivito:migrate
|
|
44
|
-
$ rake scrivito:migrate:publish
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
## Usage
|
|
48
|
-
|
|
49
|
-
If you followed the installation instructions, you have now successfully integrated the Google Maps
|
|
50
|
-
widget into your project und published the new CMS object class. Editors of your webpage can now
|
|
51
|
-
select the widget from the **Widget Browser** and immediately choose a location.
|
|
52
|
-
|
|
53
|
-
In case you want to adopt the styles of the widget, feel free to redefine the `.google-maps .map`
|
|
54
|
-
CSS class, which is the container the map gets rendered to.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
## Contributing
|
|
19
|
+
javascript_include_tag('//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places')
|
|
58
20
|
|
|
59
|
-
|
|
60
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
61
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
62
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
|
63
|
-
5. Create a new Pull Request
|
|
21
|
+
Also, add this line to your application stylesheet manifest:
|
|
64
22
|
|
|
23
|
+
*= require scrivito_google_maps_widget
|
|
65
24
|
|
|
66
|
-
|
|
67
|
-
Copyright (c) 2009 - 2014 Infopark AG (http://www.infopark.com)
|
|
25
|
+
Finally, add this line to your application JavaScript manifest:
|
|
68
26
|
|
|
69
|
-
|
|
70
|
-
http://www.gnu.org/licenses/lgpl-3.0.html for the license text.
|
|
27
|
+
//= require scrivito_google_maps_widget
|
|
@@ -8,7 +8,6 @@ $ ->
|
|
|
8
8
|
return
|
|
9
9
|
|
|
10
10
|
map.setCenter(place.geometry.location)
|
|
11
|
-
map.setZoom(17)
|
|
12
11
|
|
|
13
12
|
marker.setPosition(place.geometry.location)
|
|
14
13
|
marker.setVisible(true)
|
|
@@ -31,7 +30,7 @@ $ ->
|
|
|
31
30
|
|
|
32
31
|
mapOptions =
|
|
33
32
|
center: new google.maps.LatLng(-33.8688, 151.2195)
|
|
34
|
-
zoom:
|
|
33
|
+
zoom: parseInt(canvas.data('zoom'))
|
|
35
34
|
scrollwheel: false
|
|
36
35
|
|
|
37
36
|
map = new google.maps.Map(canvas[0], mapOptions)
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
<%= scrivito_details_for 'Height' do %>
|
|
2
|
+
<%= scrivito_tag(:div, widget, :height) %>
|
|
3
|
+
<% end %>
|
|
4
|
+
|
|
5
|
+
<%= scrivito_details_for 'Initial zoom' do %>
|
|
6
|
+
<%= scrivito_tag(:div, widget, :zoom) %>
|
|
7
|
+
<% end %>
|
|
8
|
+
|
|
1
9
|
<%= scrivito_details_for 'Address' do %>
|
|
2
10
|
<div class="google-maps" style="height: 320px">
|
|
3
11
|
<% if scrivito_in_editable_view? %>
|
|
4
|
-
<%= scrivito_tag(:input, widget, :address, type: 'text'
|
|
12
|
+
<%= scrivito_tag(:input, widget, :address, type: 'text') %>
|
|
5
13
|
<% end %>
|
|
6
14
|
|
|
7
15
|
<div class="map" data-location="<%= widget.address %>"></div>
|
|
8
16
|
</div>
|
|
9
17
|
<% end %>
|
|
10
|
-
|
|
11
|
-
<%= scrivito_details_for 'Height' do %>
|
|
12
|
-
<%= scrivito_tag(:div, widget, :height) %>
|
|
13
|
-
<% end %>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div class="google-maps" style="height: <%= widget.height %>">
|
|
2
2
|
<% if scrivito_in_editable_view? %>
|
|
3
|
-
<%= scrivito_tag(:input, widget, :address, type: 'text'
|
|
3
|
+
<%= scrivito_tag(:input, widget, :address, type: 'text') %>
|
|
4
4
|
<% end %>
|
|
5
5
|
|
|
6
|
-
<div class="map" data-location="<%= widget.address %>"></div>
|
|
6
|
+
<div class="map" data-zoom="<%= widget.zoom %>" data-location="<%= widget.address %>"></div>
|
|
7
7
|
</div>
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: scrivito_google_maps_widget
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Scrivito
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2016-02-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|