geocode

How to call google map geocode service with jquery ajax

瘦欲@ 提交于 2019-11-29 17:08:28
问题 I'm trying to get the LatLng from google map geocode api. my code is below with address values is "New York, NY" $.ajax({ url: 'http://maps.googleapis.com/maps/api/geocode/json', data: { sensor: false, address: address }, success: function (data) { alert(data) } }); But I'm not getting any values in alert. Thanks for any help. 回答1: You will need to contact the API regarding the rules. $.getJSON( { url : 'https://maps.googleapis.com/maps/api/geocode/json', data : { sensor : false, address :

Convert lat/long to pixel X&Y co-ordinates

依然范特西╮ 提交于 2019-11-29 15:39:47
问题 This type of question seems to have been asked numerous times but none of the solutions posted get me anywhere near the answer I need. I have this map of Northland, New Zealand and I'd like to map Lat/Long values to x/y (pixel) values on this image (http://i.stack.imgur.com/3ok4O.gif - which is 400px square) Right now I do not know the precise lat/long boundaries of this image, but I do have some example data which should be useful to someone who knows what they are doing. LAT LONG X Y -35

How can I change the language of Google Maps on the run?

让人想犯罪 __ 提交于 2019-11-29 02:59:55
问题 I wan't to reverse geocode and get the address in two languages arabic and english so I want to get it in one language then change the language of the API and get the address in the other language, as I can't find a parameter to send to geocoder to determine the language. Any suggestions? 回答1: A language can be selected when you load the API by appending language=XX to the API URL where XX is the two-character language code ( en for English, ar for Arabic, etc.) to the URL in the API call.

How to serialize and deserialize a JSON object from Google geocode using Java

╄→尐↘猪︶ㄣ 提交于 2019-11-28 22:08:05
I am working with Google Geocode responses, which are in JSON. The JSON format is as follows: { "status": "OK", "results": [ { "types": [ "street_address" ], "formatted_address": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA", "address_components": [ { "long_name": "1600", "short_name": "1600", "types": [ "street_number" ] }, { "long_name": "Amphitheatre Pkwy", "short_name": "Amphitheatre Pkwy", "types": [ "route" ] }, { "long_name": "Mountain View", "short_name": "Mountain View", "types": [ "locality", "political" ] }, { "long_name": "California", "short_name": "CA", "types": [

How do I do geocoding and routing with OpenStreetMap? [closed]

丶灬走出姿态 提交于 2019-11-28 16:43:06
Because Google Maps API is not available in Israel (see here ) I want to use OpenStreetMap. I'm confused by all the different ways to do geocoding, i.e. finding lat,long for an address. I'm also looking for the best way to do routing, i.e. display a route between two locations, using OSM. I'm looking for JavaScript on the client and .NET on my server. I'm also looking for a solution that will work with names in Hebrew, but I do not think this is a limitation. Routing MapQuest open offers an Open Directions Service and an Open Guidance Service . Additional information about Routing in

Increase the api limit in ggmap's geocode function (in R)

半世苍凉 提交于 2019-11-28 05:31:14
I'm trying to use the geocode function from the ggmaps library in R to get coordinates for specific locations. I'm able to use the function fine so far. The issue I'm running into is that I would like to increase my daily limit from 2,500 to 100,000 . The official Google documentation says that this is readily possible if you enable billing on the project, which I'm happy to do. When you proceed with this process, the Google Developers Console gives you a personalized API key. However, the geocode function doesn't have an option to put in this personalized API key. Instead, it asks for the

Google's Geocoder returns wrong country, ignoring the region hint

我怕爱的太早我们不能终老 提交于 2019-11-28 04:08:53
I'm using Google's Geocoder to find lat lng coordinates for a given address. var geocoder = new google.maps.Geocoder(); geocoder.geocode( { 'address': address, 'region': 'uk' }, function(results, status) { if(status == google.maps.GeocoderStatus.OK) { lat: results[0].geometry.location.lat(), lng: results[0].geometry.location.lng() }); address variable is taken from an input field. I want to search locations only in UK . I thought that specifying 'region': 'uk' should be enough but it's not. When I type in "Boston" it's finding Boston in US and I wanted the one in UK. How to restrict Geocoder

Calculate distance of two geo points in km c#

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 19:51:44
I`d like calculate the distance of two geo points. the points are given in longitude and latitude. the coordinates are: point 1: 36.578581, -118.291994 point 2: 36.23998, -116.83171 here a website to compare the results: http://www.movable-type.co.uk/scripts/latlong.html here the code I used from this link: Calculate distance between two points in google maps V3 const double PIx = Math.PI; const double RADIO = 6378.16; /// <summary> /// Convert degrees to Radians /// </summary> /// <param name="x">Degrees</param> /// <returns>The equivalent in radians</returns> public static double Radians

Android - How to get current location (latitude and longitude)?

◇◆丶佛笑我妖孽 提交于 2019-11-27 19:27:56
I am using the following code to get the current location namely (latitude and longitude), but I am not getting current location (latitude and longitude). Anyone knows why? package com.ram.currentlocation; import android.app.Activity; import android.content.Context; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import android.widget.Toast; public class Location_Gps extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super

Geocoder, how to test locally when ip is 127.0.0.1?

谁说胖子不能爱 提交于 2019-11-27 18:12:43
I can't get geocoder to work correct as my local ip address is 127.0.0.1 so it can't located where I am correctly. The request.location.ip shows "127.0.0.1" How can I use a different ip address (my internet connection ip) so it will bring break more relevant data? A nice clean way to do it is using MiddleWare. Add this class to your lib directory: # lib/spoof_ip.rb class SpoofIp def initialize(app, ip) @app = app @ip = ip end def call(env) env['HTTP_X_FORWARDED_FOR'] = nil env['REMOTE_ADDR'] = env['action_dispatch.remote_ip'] = @ip @status, @headers, @response = @app.call(env) [@status,