apneadiving / Google-Maps-for-Rails

Enables easy Google map + overlays creation in Ruby apps
https://apneadiving.github.io/
MIT License
2.27k stars 382 forks source link

Getting error in base.js #462

Closed manoj2411 closed 9 years ago

manoj2411 commented 9 years ago

Hey,

I just followed the given steps and whenever I am trying to build handler with

handler = Gmaps.build('Google');

I am getting this error in javascript console

Uncaught ReferenceError: _ is not defined 

And it is coming from line nuber 8 of gmaps/base.js

model = _.isFunction(options.handler) ? options.handler : Gmaps.Objects.Handler;

The whole content of gmaps/base.js is

(function() {
  this.Gmaps = {
    build: function(type, options) {
      var model;
      if (options == null) {
        options = {};
      }
      model = _.isFunction(options.handler) ? options.handler : Gmaps.Objects.Handler;
      return new model(type, options);
    },
    Builders: {},
    Objects: {},
    Google: {
      Objects: {},
      Builders: {}
    }
  };

}).call(this);

Did I missed or messed something?

apneadiving commented 9 years ago

Yes, underscore js is a required dependency

joumanae commented 8 years ago

Hi! I get the same error. I am not sure how to fix it? How do you get underscore.js to work?