Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding OpenLayers to rails project

I have been reading some posts related with this issue, but i couldn't get this working.

I tried to use the 'openlayers-rails' gem and also i tried adding the OpenLayers folder to /vendor/assets/javascript/ (with the require //= require OpenLayers/OpenLayers into the /assets/javascript/application.js file). I both scenarios i get "Uncaught ReferenceError: OpenLayers is not defined" as a browser inspector error.

Any help is appreciated! Thanks

like image 675
halbano Avatar asked Dec 05 '25 10:12

halbano


1 Answers

The README for the openlayers-rails gem says that you should include the JS this way:

//= require openlayers-rails

Not with //= require OpenLayers/OpenLayers

like image 127
Jeremy Green Avatar answered Dec 06 '25 23:12

Jeremy Green



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!