Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8231955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:40:00+00:00 2026-06-07T17:40:00+00:00

Has anyone figured out how to integrate Stamen tiles with Gmaps4rails? It’s a bit

  • 0

Has anyone figured out how to integrate Stamen tiles with Gmaps4rails? It’s a bit confusing since google.maps isn’t explicitly called in the Gmaps4Rails gem. Would love any advice on how to hook in the required information.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T17:40:02+00:00Added an answer on June 7, 2026 at 5:40 pm

    I have found a (rough) way to create a slippy map with OSM tiles using gmaps4rails. By the looks of it it should be even easier with stamen maps. You might find some hints how to get this working with the gem looking at my solution here : Slippy maps for gmaps4rails

    I hadn’t come across stamen maps before. They look amazing. A shame the Terrain map isn’t available in Europe. I will play with it tomorrow and see if I can find out more.

    Edit:

    In gmaps4rails.base.js.coffee add this method:

     #creates a Stamen Map layer with the mapTypeId "toner"
     createStamenMap : ->
      StamenMapTypeOptions = new google.maps.ImageMapType(
        getTileUrl: (coord, zoom) ->
          "http://tile.stamen.com/toner/" + zoom + "/" + coord.x + "/" + coord.y + ".png"
        tileSize: new google.maps.Size(256, 256)
        name: "toner"
        maxZoom: 18
      )
      @serviceObject.mapTypes.set("toner", StamenMapTypeOptions)
      @serviceObject.setMapTypeId("toner")
    

    If you want watercolor or terrain you need to swap wherever it says toner for what you like (including in the TileUrl!).

    In js_builder.rb add a call to your method like this

    @js << "#{gmap_id}.createStamenMap();"

    just after @js << "#{gmap_id}.initialize();".

    If you use rvm like me js_builder.rb will not be in your app directory, for me it’s in /Users/<username>/.rvm/gems/ruby-1.9.3-p194/gems/gmaps4rails-1.5.2

    Lastly, change your view code like this:

     <%= gmaps("markers" => {"data" => @json},
                    "map_options" => {"type" => "TERRAIN", :raw => '{mapTypeControlOptions: {mapTypeIds: ["toner", google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.TERRAIN], style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}}'}) %>
    

    I am sure there is a prettier way of doing this but it seems to work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone figured out how the Very Sleepy profiler finds PDB files? It seems
Has anyone figured out how to return the SQL for an object that is
Has anyone figured out how to angle a text field in a form? I'm
Has anyone figured out a good way to embed video and audio into showoff
I know iBooks has this little nuance built in. Has anyone figured out how
Has anyone figured out a way to have more than one entity namespace within
Has anyone figured out a way to use matlab to send email from a
Has anyone figured out a good way to make a hidden table/matrix column take
Has anyone figured out a good way to detect if the client's browser is
Has anyone figured out how to delete an event using the Facebook php-sdk? Not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.