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

  • Home
  • SEARCH
  • 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 8057357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:00:24+00:00 2026-06-05T09:00:24+00:00

I am using CoffeeScript, Backbone.js and Google Maps API to reverse geocode a lat

  • 0

I am using CoffeeScript, Backbone.js and Google Maps API to reverse geocode a lat / lng

I have the function

  country: (origin, callback) ->
    @geocoder = new google.maps.Geocoder
    @geocoder.geocode(
        'latLng': origin,
        (results, status) => 
            if status is google.maps.GeocoderStatus.OK
              callback(result[6])
            else alert("Geocode was not successful for the following reason: " + status);
    )

When I call this I use:

@country(origin, (data) =>
   console.log(data.formatted_address)
)

btw:

origin = new google.maps.LatLng(origin_lat, origin_lng)

This does not work, it does not even seem to call it. I have the call back function under (data) but can not get it to work…

Thanks

  • 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-05T09:00:26+00:00Added an answer on June 5, 2026 at 9:00 am

    Not sure about the overall context of your question, but I will take a stab at it anyway.

    The way you’ve defined your country function, it will typically be part of an object or map. If you just want a standalone function, try:

    country = (origin, callback) ->
       ...
    

    Then when calling it, try to replace @country(...) with country(...).

    Based on the comments, your call to geocode also looks wrong. You need to create an instance of GeocoderRequest and pass it instead of the 'latLng': origin pair. Unfortunately I haven’t used the Google style APIs much, so if this is your real question I’m not much use to you.

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

Sidebar

Related Questions

I'm fairly new to using coffeescript and I have the following code eventBus =
I am working on rails 3.2 and using coffeescript too.. I have a doubt
I have recently started using coffeescript with Rails and I am finding that sometimes
Im using backbone, require.js and coffeescript in a application. Programming my app, discovered i
Using Coffeescript I need to have a go through a build script anyway to
I made a registration form using backbone.js, CoffeeScript and jquery. I am trying to
How would you extend a class using CoffeeScript, but have the construction arguments passed
I'm using CoffeeScript with a Backbone view class. When I include the class in
I am building a backbone.js app on a Rails 3.1 back-end. I'm using CoffeeScript
I'm using the following Coffeescript code to validate that initialization of one backbone.js view

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.