File tree 3 files changed +7
-3
lines changed
3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -10,5 +10,6 @@ TR_API_KEY=yourapikey
10
10
TR_BASE_URI = https://www.taskrabbit.com
11
11
12
12
# Google Static Maps API Key (https://developers.google.com/maps/documentation/javascript/tutorial#api_key)
13
- # An API key is not required to use the Google Static Maps API, but this app is set up to use one.
13
+ # An API key is not required to use the Google Static Maps API, but there is a 640px max size limit
14
+ # when using it without a key (map on the new order page is 700px wide).
14
15
GMAPS_STATIC_API_KEY = yourgmapsapikey
Original file line number Diff line number Diff line change @@ -27,7 +27,10 @@ BurgerToMe = {
27
27
var zoom = 12 ;
28
28
var size = "700x200" ;
29
29
30
- var map_image_base_url = "//maps.googleapis.com/maps/api/staticmap?size=" + size + "&maptype=roadmap&sensor=false&key=" + this . GMAPS_STATIC_API_KEY ;
30
+ var map_image_base_url = "//maps.googleapis.com/maps/api/staticmap?size=" + size + "&maptype=roadmap&sensor=false" ;
31
+ if ( this . GMAPS_STATIC_API_KEY ) {
32
+ map_image_base_url += "&key=" + this . GMAPS_STATIC_API_KEY
33
+ }
31
34
32
35
var field_name_map = _ ( { // this object maps our form fields to google maps place object fields
33
36
'address_address' : [ 'street_number' , 'route' ] ,
Original file line number Diff line number Diff line change 46
46
< section class ="location boxed ">
47
47
< header > Deliver To: < span class ="address "> <%= @order . location %> </ span > </ header >
48
48
< article >
49
- < img class ="location_map " src ="//maps.googleapis.com/maps/api/staticmap?size=700x200¢er=<%= @order . lat_lng_for_url %> &markers=size:large%7Ccolor:red%7C<%= @order . lat_lng_for_url %> &zoom=15&maptype=roadmap&sensor=false&key= <%= ENV [ 'GMAPS_STATIC_API_KEY' ] %> ">
49
+ < img class ="location_map " src ="//maps.googleapis.com/maps/api/staticmap?size=700x200¢er=<%= @order . lat_lng_for_url %> &markers=size:large%7Ccolor:red%7C<%= @order . lat_lng_for_url %> &zoom=15&maptype=roadmap&sensor=false <%= "&key= #{ ENV [ 'GMAPS_STATIC_API_KEY' ] } " if ENV [ 'GMAPS_STATIC_API_KEY' ] %> ">
50
50
</ article >
51
51
</ section >
52
52
</ div >
You can’t perform that action at this time.
0 commit comments