joshuamiller / cartographer Goto Github PK
View Code? Open in Web Editor NEWGoogle Maps on Rails
Google Maps on Rails
The examples in the readme are too brief and also do not work.
e.g.
@Map = Cartographer::Gmap.new( 'map' )
@map.zoom = 4
@map.center = [-40,174]
@map.debug = true
@map = Cartographer::Gmap.new( 'map' )
@map.zoom = :bound
@map.debug = true
normal_icon = Cartographer::Gicon.new
@map.icons << normal_icon
marker1 = Cartographer::Gmarker.new(:name=> "taj_mahal", :marker_type => "Building",
:position => [27.173006,78.042086], :icon => normal_icon,
:info_window_url => "/url_for_info_content")
marker2 = Cartographer::Gmarker.new(:name=> "raj_bhawan", :marker_type => "Building",
:position => [28.614309,77.201353],
:icon => normal_icon,
:info_window_url => "/url_for_info_content")
@map.markers << marker1
@map.markers << marker2
Hi, I am not sure if this is a bug or something I am missing. I have played around with it and do not see what else it could be.
Env: Rails 3, Ruby 1.8.7
I get the error: NameError (uninitialized constant CouponsController::Cartographer):
When in my production environment(heroku). It works nicely on development on my local machine (OSX). Thank you.
Is there any way to search for business in a specific location. e.g. "Pub in London" and extracting the business info?
Hi there - I have seen mention of some issues regarding heroku on stackoverflow but no obvious fix. I am running the gem locally and all is well - but as soon as I deploy to heroku it bails - checking the logs, the error is as follows:
NameError (uninitialized constant PagesController::Cartographer):
2011-02-20T13:56:26-08:00 app[web.1]: app/controllers/pages_controller.rb:39:in initialize_map' 2011-02-20T13:56:26-08:00 app[web.1]: app/controllers/pages_controller.rb:3:in
index'
...is there a fix for this in the pipeline? Great gem!
i have a problem with using Cartographer with rails3.
I've done everything just like in the docs and all i'm getting is this error: undefined method 'has_key?' for false:FalseClass
in this line:
<% raw Cartographer::Header.new.to_s %>
Has anyone any idea what am i doing wrong? Any help would be appreciated
ps. here is the link to the stackoverflow question: http://stackoverflow.com/questions/7568385/cartographer-undefined-method-has-key
I'd like to draw a fixed size 3 mile circle around a point in cartographer. I looked for the DrawCircle class from the Google API, but could not find it. How do you recommend drawing a fixed-size circle around a point in Cartographer?
Rails 3
Ruby 1.9.2
Done everything like in example
NoMethodError in Map#index
~/app/views/map/index.html.haml where line #2 raised:
undefined method `name' for :normal:Symbol
Extracted source (around line #2) (HAML):
1: = raw Cartographer::Header.new.to_s
2: = raw @map.to_html
Trace:
vendor/plugins/cartographer/lib/v3/cartographer/gmarker.rb:57:in to_js' vendor/plugins/cartographer/lib/v3/cartographer/gmap.rb:174:in
block in to_js'
vendor/plugins/cartographer/lib/v3/cartographer/gmap.rb:173:in each' vendor/plugins/cartographer/lib/v3/cartographer/gmap.rb:173:in
to_js'
vendor/plugins/cartographer/lib/v3/cartographer/gmap.rb:88:in to_html' app/views/map/index.html.haml:2:in
_app_views_map_index_html_haml___869769418_90224840_303366198'
actionpack (3.0.3) lib/action_view/template.rb:135:in block in render' activesupport (3.0.3) lib/active_support/notifications.rb:54:in
instrument'
actionpack (3.0.3) lib/action_view/template.rb:127:in render' actionpack (3.0.3) lib/action_view/render/rendering.rb:59:in
block in _render_template'
activesupport (3.0.3) lib/active_support/notifications.rb:52:in block in instrument' activesupport (3.0.3) lib/active_support/notifications/instrumenter.rb:21:in
instrument'
activesupport (3.0.3) lib/active_support/notifications.rb:52:in instrument' actionpack (3.0.3) lib/action_view/render/rendering.rb:56:in
_render_template'
actionpack (3.0.3) lib/action_view/render/rendering.rb:26:in render' haml (3.0.25) lib/haml/helpers/action_view_mods.rb:13:in
render_with_haml'
actionpack (3.0.3) lib/abstract_controller/rendering.rb:114:in _render_template' actionpack (3.0.3) lib/abstract_controller/rendering.rb:108:in
render_to_body'
actionpack (3.0.3) lib/action_controller/metal/renderers.rb:47:in render_to_body' actionpack (3.0.3) lib/action_controller/metal/compatibility.rb:55:in
render_to_body'
actionpack (3.0.3) lib/abstract_controller/rendering.rb:101:in render_to_string' actionpack (3.0.3) lib/abstract_controller/rendering.rb:92:in
render'
actionpack (3.0.3) lib/action_controller/metal/rendering.rb:17:in render' actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:40:in
block (2 levels) in render'
activesupport (3.0.3) lib/active_support/core_ext/benchmark.rb:5:in block in ms' /home/sarunas/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/benchmark.rb:309:in
realtime'
activesupport (3.0.3) lib/active_support/core_ext/benchmark.rb:5:in ms' actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:40:in
block in render'
actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:78:in cleanup_view_runtime' activerecord (3.0.3) lib/active_record/railties/controller_runtime.rb:15:in
cleanup_view_runtime'
actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:39:in render' vendor/plugins/active_scaffold/lib/extensions/action_controller_rendering.rb:13:in
render_with_active_scaffold'
actionpack (3.0.3) lib/action_controller/metal/implicit_render.rb:10:in default_render' actionpack (3.0.3) lib/action_controller/metal/implicit_render.rb:5:in
send_action'
actionpack (3.0.3) lib/abstract_controller/base.rb:151:in process_action' actionpack (3.0.3) lib/action_controller/metal/rendering.rb:11:in
process_action'
actionpack (3.0.3) lib/abstract_controller/callbacks.rb:18:in block in process_action' activesupport (3.0.3) lib/active_support/callbacks.rb:460:in
_run__362454126__process_action__330680296__callbacks'
activesupport (3.0.3) lib/active_support/callbacks.rb:409:in _run_process_action_callbacks' activesupport (3.0.3) lib/active_support/callbacks.rb:93:in
run_callbacks'
actionpack (3.0.3) lib/abstract_controller/callbacks.rb:17:in process_action' actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:30:in
block in process_action'
activesupport (3.0.3) lib/active_support/notifications.rb:52:in block in instrument' activesupport (3.0.3) lib/active_support/notifications/instrumenter.rb:21:in
instrument'
activesupport (3.0.3) lib/active_support/notifications.rb:52:in instrument' actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:29:in
process_action'
actionpack (3.0.3) lib/action_controller/metal/rescue.rb:17:in process_action' actionpack (3.0.3) lib/abstract_controller/base.rb:120:in
process'
actionpack (3.0.3) lib/abstract_controller/rendering.rb:40:in process' actionpack (3.0.3) lib/action_controller/metal.rb:138:in
dispatch'
actionpack (3.0.3) lib/action_controller/metal/rack_delegation.rb:14:in dispatch' actionpack (3.0.3) lib/action_controller/metal.rb:178:in
block in action'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:62:in call' actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:62:in
dispatch'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:27:in call' rack-mount (0.6.13) lib/rack/mount/route_set.rb:148:in
block in call'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:93:in block in recognize' rack-mount (0.6.13) lib/rack/mount/code_generation.rb:68:in
optimized_each'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:92:in recognize' rack-mount (0.6.13) lib/rack/mount/route_set.rb:139:in
call'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:492:in call' haml (3.0.25) lib/sass/plugin/rack.rb:41:in
call'
warden (1.0.3) lib/warden/manager.rb:35:in block in call' warden (1.0.3) lib/warden/manager.rb:34:in
catch'
warden (1.0.3) lib/warden/manager.rb:34:in call' actionpack (3.0.3) lib/action_dispatch/middleware/best_standards_support.rb:17:in
call'
actionpack (3.0.3) lib/action_dispatch/middleware/head.rb:14:in call' rack (1.2.1) lib/rack/methodoverride.rb:24:in
call'
actionpack (3.0.3) lib/action_dispatch/middleware/params_parser.rb:21:in call' actionpack (3.0.3) lib/action_dispatch/middleware/flash.rb:182:in
call'
actionpack (3.0.3) lib/action_dispatch/middleware/session/abstract_store.rb:149:in call' actionpack (3.0.3) lib/action_dispatch/middleware/cookies.rb:295:in
call'
activerecord (3.0.3) lib/active_record/query_cache.rb:32:in block in call' activerecord (3.0.3) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in
cache'
activerecord (3.0.3) lib/active_record/query_cache.rb:12:in cache' activerecord (3.0.3) lib/active_record/query_cache.rb:31:in
call'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:353:in call' actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:46:in
block in call'
activesupport (3.0.3) lib/active_support/callbacks.rb:415:in _run_call_callbacks' actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:44:in
call'
rack (1.2.1) lib/rack/sendfile.rb:107:in call' actionpack (3.0.3) lib/action_dispatch/middleware/remote_ip.rb:48:in
call'
actionpack (3.0.3) lib/action_dispatch/middleware/show_exceptions.rb:46:in call' railties (3.0.3) lib/rails/rack/logger.rb:13:in
call'
rack (1.2.1) lib/rack/runtime.rb:17:in call' activesupport (3.0.3) lib/active_support/cache/strategy/local_cache.rb:72:in
call'
rack (1.2.1) lib/rack/lock.rb:11:in block in call' <internal:prelude>:10:in
synchronize'
rack (1.2.1) lib/rack/lock.rb:11:in call' actionpack (3.0.3) lib/action_dispatch/middleware/static.rb:30:in
call'
railties (3.0.3) lib/rails/application.rb:168:in call' railties (3.0.3) lib/rails/application.rb:77:in
method_missing'
railties (3.0.3) lib/rails/rack/log_tailer.rb:14:in call' rack (1.2.1) lib/rack/content_length.rb:13:in
call'
rack (1.2.1) lib/rack/handler/webrick.rb:52:in service' /home/sarunas/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/webrick/httpserver.rb:111:in
service'
/home/sarunas/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/webrick/httpserver.rb:70:in run' /home/sarunas/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/webrick/server.rb:183:in
block in start_thread'
I solved my own issue.
[Delete Please]
I would have deleted it myself but cannot. Sorry about the inconvenience.
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb.
Hi Joshua. Can you please tell me what is the best way to deal with this? Thanks, Abram
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.