geocoding

googleapis geocode APPROXIMATE and wrong location

↘锁芯ラ 提交于 2019-12-12 02:29:48
问题 The following request results in wrong (approx.) coordinates (about 600 meters from correct location): http://maps.googleapis.com/maps/api/geocode/json?address=Garbatyplatz+2+13187+Berlin&sensor=true => "lat" : 52.57206610, "lng" : 13.41266040 www.google.com/maps/preview#!q=52.57206610%2C+13.41266040 But if you look for the address directly in google maps, it is correct: https://www.google.de/maps/preview#!q=Garbatyplatz+2+13187+Berlin Anybody an idea why the result is approx. and so much off

Google maps: Reading geocode per XML

谁说我不能喝 提交于 2019-12-12 02:17:49
问题 I have the following code for converting a PHP variable (including an address) into coordinates: $evdata_address = urlencode($evdata_address); $mapsurl = 'http://maps.googleapis.com/maps/api/geocode/xml?address=' . $evdata_address . '&sensor=true'; $xml = simplexml_load_file($mapsurl); $status = $xml->status; if ($status == 'OK') { $latitude = $xml->result->geometry->location->lat; $longitude = $xml->result->geometry->location->lng; }; For some reason it works perfectly on my own webspace

Adding custom icon and marker data together using Mapbox

对着背影说爱祢 提交于 2019-12-12 01:59:30
问题 I am new to mapbox and I have a simple question. I have made a feature layer and a list of custom icons. How do I add the two together? My feature layer is formatted as below: L.mapbox.featureLayer({ "type": "Feature", "geometry": { "coordinates": [ '.$long.','.$lat.' ], "type": "Point" }, "properties": { "title": "'.$business_name.'", "description": "'.$address_1.', '.$address_2.', '.$address_3 .', '.$postcode .'" } }).addTo(map); And example of my custom marker is below var accomodation = L

Geocoder often returns null vallues in Android

点点圈 提交于 2019-12-11 23:17:50
问题 I am trying to pass geocoder values from MapFragment to LocationDetailsActivity. I get the correct values for lat and lng, but when I try to display any of the other values, most of the times I get null values instead of the city and zip (but not always), while a lot of the times I get the correct country and state (also not always). MapFragment Code: // Set default latitude and longitude double latitude = 15.4825766; double longitude = -5.0076589; // Get latitude and longitude of the current

Plot Button to Add Latitude and Longitude to input fields? Geocode

半世苍凉 提交于 2019-12-11 19:12:04
问题 I have a form and one of my inputs lets my user input their office location (address) From this address I want to plot a google map on their profile. I would like them to supply the long's and lat's but they will have no idea how. Is there a way the user can populate the long and lat fields by entering an address into the address field and then pressing a plot button which will return the long and lats and input them into the appropriate fields. My code so far is as follows (I made a JSFiddle

How to convert lat longs into degree format for Google Earth?

笑着哭i 提交于 2019-12-11 18:54:14
问题 I have lat/long coordinates for a list of ports. The coordinates are in a 2856N 05211E format (totally made those numbers up, btw). I'm trying to figure out how I can convert them to the degree format the Google Earth pluginuses in order to plot them on a map. Is there a parameter in the API that I could use to convert this? Any ideas would be appreciated. 回答1: I'm assuming you can parse the values yourself. If not, then provide the language you wish to use. The conversion is simple, Degrees

Get Bounding Box from lat/long and distance

情到浓时终转凉″ 提交于 2019-12-11 16:16:46
问题 Im using twitter stream api for my ios project. Stream API has a location parameter. How can i get bounding box coordinates from user location(lat/long) and 1km distance ? Is there any API or tool in MapKit or mathematical functions ? Input (latitude = 37.785834, longitude = -122.406417) Distance = 1000 meter Output latMin: 37.789934 longMin : -122.416417 latMax: 37.787834 longMax : -122.396417 回答1: Yep, check out the functions in <MapKit/MKGeometry.h> like MKMetersPerMapPointAtLatitude() ,

Get country code based on user's current location Android

末鹿安然 提交于 2019-12-11 14:48:59
问题 I have already tried out the following code to get country code name TelephonyManager tm = (TelephonyManager)getActivity().getSystemService(getActivity().TELEPHONY_SERVICE); String countryCodeValue = tm.getNetworkCountryIso(); But I guess this does not work if I want to get current country code in which the user is. For example if user travels from one country to another I want to get the country code in which he is in. I have a solution to get user's current country code but I am stuck: I

Calculating Google map's viewport?

和自甴很熟 提交于 2019-12-11 14:38:50
问题 I'm doing a bit of geocoding using Google Local Search and need to be able to set the viewport of a google maps api v3 object on the page. Now this is fine if google local search has returned me a good viewport as it does for a postcode or street but if i put in the name of a bar for example. The viewport returned is very large presumable because local search has found many matches but has returned the best. I'd like to calculate my own viewport in this case and am doing so in the following

Verify user input location string is a valid geographic location?

☆樱花仙子☆ 提交于 2019-12-11 10:27:10
问题 I'm accepting a user input which is supposed to be a geographic location. I would like to validate that what the user has entered describes a location--e.g., postal code, airport code, street address, city name, etc. The obvious answer is to use the Google Geocode API to do a request for the user's input and see if I get any results.) However the geocode ToS forbids this: ...the Geocoding API may only be used in conjunction with a Google map; geocoding results without displaying them on a map