0

Is it posible to create an image with IMGKit with google maps on it?

The problem is that i need to 'include' some javascript, but with IMGKit you can't include javascript from a remote server.

Is there a way to include:

= javascript_include_tag "//maps.google.com/maps/api/js?v=3.13&sensor=false&libraries=geometry"
= javascript_include_tag "//google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplus/2.0.14/src/markerclusterer_packed.js"

to the IMGKit?

kit = IMGKit.new(html, :quality => 100, :width => 500, :height => 500)
kit.stylesheets << 'app/assets/stylesheets/some_style.scss'
kit.stylesheets << '//maps.google.com/maps/api/js?v=3.13&sensor=false&libraries=geometry'
kit.stylesheets << '//google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplus/2.0.14/src/markerclusterer_packed.js'

Thanks for your help.

Stone
  • 2,912
  • 1
  • 21
  • 18
  • 1
    I think you should try the google maps image api (not sure how it's called but you will be able to find it). Initialising javascript api may be a problem with this setup – Mike Szyndel Nov 09 '15 at 14:38
  • awesome thanks. i will post an answer asap. – Stone Nov 09 '15 at 15:15

1 Answers1

0

If anyone needs to create an image from an google map with IMGKit you can use the Static Google Map API.

To generate such an image in rails have a look at this link.

Stone
  • 2,912
  • 1
  • 21
  • 18