Skip to content

Gmaps is not defined #549

Open
Open
@MiguelFCoelho

Description

@MiguelFCoelho

I´m developing an website in ROR

I am using gem 'gmaps4rails'.

In localhost the map is showed, but when i put on a production server (DigitalOcean) gives me this error: Uncaught ReferenceError: Gmaps is not defined

i have this script in my index.html.erb:

<div id="map_show" ></div>
</div>
<script type="text/javascript">  
      handler = Gmaps.build('Google');
handler.buildMap({ provider: {}, internal: {id: 'map_show'}}, function(){
 markers = handler.addMarkers(<%=raw @hash.to_json %>);

  handler.bounds.extendWith(markers);
  handler.fitMapToBounds();
});
        </script>

My application.js is this:

//= require jquery
//= require bootstrap-sprockets
//= require jquery_ujs
//= require turbolinks
//= require underscore
//= require gmaps/google
//= require highcharts
//= require chartkick 
//= require_tree .

Anyone know how can i resolve my problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions