maps

Google Maps v3 load partially on top left corner, resize event does not work

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Google Maps V3 loaded partially on top left corner. I tried the following methods: Add google.maps.event.trigger(map, 'resize'); after map initialization. Rearrange <script> tag in index file But none works for me. How to solve this issue. Is there an official bug and solution to this issue? index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Bootstrap, from LayoutIt!</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content="">

Showing a marker at a geo:-url in Android Maps

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is it possible not only to have Google Maps on Android show a given coordinate in the Maps Application but have also a marker (or pin) set at the location? I read the documentation at https://developer.android.com/guide/appendix/g-app-intents.html but it only lets me set the zoom level. Right now I use the following code to show a place in Google Maps on Android: Double lat = 53.3; Double lng = 13.4; final String uriString = "geo:" + lat + ',' + lng + "?z=15"; Intent showOnMapIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(uriString));

Google Maps API v3 - How to clear overlays?

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: In Google Maps API v2, I was using map.clearOverlays() to remove the marker and draw them again. How can I do that using Google Maps API v3 ? Thanks 回答1: See here for details on the various options open to you but you now have to iterate through the markers and remove them individually. Your code should look something like this: var markers = []; function clearOverlays () { while ( markers . length ) { markers . pop (). setMap ( null ); } markers . length = 0 ; } markers . push ( marker ); google . maps . event . addListener (

Best way to merge two maps and sum the values of same key?

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: val map1 = Map(1 -> 9 , 2 -> 20) val map2 = Map(1 -> 100, 3 -> 300) I want to merge them, and sum the values of same keys. So the result will be: Map(2->20, 1->109, 3->300) Now I have 2 solutions: val list = map1.toList ++ map2.toList val merged = list.groupBy ( _._1) .map { case (k,v) => k -> v.map(_._2).sum } and val merged = (map1 /: map2) { case (map, (k,v)) => map + ( k -> (v + map.getOrElse(k, 0)) ) } But I want to know if there are any better solutions. 回答1: Scalaz has the concept of a Semigroup which captures what you want to do here

How do I use the Google Maps API GPS sensor?

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: All I've been able to find is how to specify the sensor parameter: http://code.google.com/apis/maps/documentation/v3/#SpecifyingSensor But nowhere does it say how to actually USE it. Isn't the whole point to be able to get the user's current lat/long coordinates through the device GPS, or am I mistaken? 回答1: That sensor parameter is only there to indicate to Google that you are using a GPS sensor to determine the user's location. Unless using the W3C Geolocation API in browsers that support it, it remains your responsibility to get the

how to create maps which detect automatic location in React-Native

妖精的绣舞 提交于 2019-12-03 02:04:12
I have created maps in react-native referring to https://github.com/lelandrichardson/react-native-maps map is created but i want to detect automatic location using gps. Here is the code which renders map with static latitude and longitude. Here's my updated code. But it still not rendering perfect location getInitialState() { return { initialPosition: 'unknown', lastPosition: 'unknown', }; }, componentDidMount() { navigator.geolocation.getCurrentPosition( (position) => { var initialPosition = JSON.stringify(position); this.setState({initialPosition}); }, {enableHighAccuracy: true, timeout:

Google Maps are not showing with domainname.com

匿名 (未验证) 提交于 2019-12-03 02:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: JavaScript: JavaScript Function: I reads following questions but my problem is not solved. Google Maps JavaScript API RefererNotAllowedMapError Google maps API referrer not allowed Google Maps API error: Google Maps API error: RefererNotAllowedMapError The problem is , when i open my website like this. http://mysiste.com/contactus it is not showing map and showing following error. Google Maps API error: RefererNotAllowedMapError https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error Your site

howto: dynamically update markers from JSON on google maps

匿名 (未验证) 提交于 2019-12-03 02:02:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to update the location of a marker with out refreshing the whole page. I have tried to use setTimeout(function() however I am having no luck.. here is my code I have so far.. thanks in advance function initialize() { var mapOptions = { center: new google.maps.LatLng(35.66, -80.50), zoom: 8, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); var json = (function () { var json = null; $.ajax({ 'async': false, 'global': false, 'url': "getjson.php", 'dataType'

Adding a KML layer to an Android maps application

匿名 (未验证) 提交于 2019-12-03 02:01:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have been starting out in the world of Android development recently and I am working on an application which shows a map using the Google API SDK, it is pretty much the original example but edited a little bit. It works a treat but I wish to do more with it. My question is: How do you add a KML layer to this? I've not found many examples out there and none of them are very clear. I know how to do this with Javascript on websites but not in android. Can anyone help? 回答1: Google added a support to KML recently in its utility lib. You can

Use google maps computeDistanceBetween to get the closest location returns NaN

匿名 (未验证) 提交于 2019-12-03 02:01:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Ok so I have set up a map and an autocomplete field on a testing site. My goal is to get the user to input his/her address into the field and then when he/she clicks confirm work out the closest store to them based on the information provided. I have the lat/long for each store and with the help of autocomplete I now have the lat/long of the users address but when I use the computeDistanceBetween method provided in the documentation I get NaN instead of a desired result. Here is a link to the test site to get an idea - http://dev