Tyler Polzin


210 Experience
2 Lessons Completed
0 Questions Solved


Posted in How to use Google Maps and Markers Discussion

Super late reply, but I figured out how to properly import this while using Webpack and Rails.

In your application.js file, instead of simply having import 'gmaps';, do the following:

import 'gmaps';
import GMaps from 'gmaps';
window.GMaps = GMaps;

This also applies for those of you (like me) who keep getting "function is not defined" errors.

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2020 GoRails, LLC. All rights reserved.