maps

How to handle requireJs timeout error?

匿名 (未验证) 提交于 2019-12-03 08:44:33
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm writing a mobile hybrid app using require.js as my loading framework. I have an issue with loading errors. What I'm trying to do is setup a fallback solution when the device is offline and I can't download the google maps API script that I need to display a map on the screen. All that I get is Uncaught Error : Load timeout for modules : async ! http : //maps.googleapis.com/maps/api/js?sensor=true but I'm not able to catch this error and provide an alternative implementation. Here is my gmaps module definition define ( 'gmaps' ,

Make Google Maps retain zoom and center after refresh?

匿名 (未验证) 提交于 2019-12-03 08:41:19
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How do I make Google Maps retain the user's view (zoom level and center point) after an HTTP refresh? Right now, it resets the view after each refresh. Can I tweak the code below to say "zoom: current zoom level" and "center: current center location" somehow? function initialize() { var myLatLng = new google.maps.LatLng(0,0); var myOptions = { zoom: 2, center: myLatLng, mapTypeId: google.maps.MapTypeId.TERRAIN }; I have figured out some other ways to do this for http://test.barrycarter.info/sunstuff.html but they're all considerably harder.

Attempt to get length of null array in google maps V2 android app

匿名 (未验证) 提交于 2019-12-03 08:41:19
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am currently developing an android application using google maps api and I sometimes get a weird crash (in my opinion) for no ovious reason. Here's the crash log : 12-02 16:38:57.071 20796-21137/com.appsolute.ParkYoo E/AndroidRuntime: FATAL EXCEPTION: GLThread 4623 Process: com.appsolute.ParkYoo, PID: 20796 java.lang.NullPointerException: Attempt to get length of null array at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:399) at java.nio.ByteBufferAsShortBuffer.put(ByteBufferAsShortBuffer.java:159) at com.google.maps.api.android

Leaflet.js - Draw polyline to nearest point from a location

て烟熏妆下的殇ゞ 提交于 2019-12-03 08:34:19
I need to draw a polyline between two points using the shortest distance. Example, my location is New York, I have a location in China and I want to draw a polyline connecting the two locations. Where I am - see fiddle here: http://jsfiddle.net/Vsq4D/1/ The problem is that when I draw the line it does use the shortest distance. In the above example it draws from the US to China with the line going to the right, the longest way round the Earth, not the left, which is the shortest way. What am I missing? Any ideas how to draw the line according to the shortest distance? Any help much appreciated

Work with native infoWindows of interesting places in google maps api

匿名 (未验证) 提交于 2019-12-03 08:33:39
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I don't know how it's called, so here are the screens. Any map, embedded with API, has these small markers with restaurants, hotels and other locals: When user clicks on some, there's beauty infoWindow with description, phone, link and rating: So what is this and how to work with this? I want to update these infoWindows with my own controls. 回答1: I've found the answer that solves this task completely. Here it is: Can I remove just the popup bubbles of POI's in Google Maps API v3? . It's about removing POI's infoWindows, but the

Adding dynamic content to Google Maps marker

匿名 (未验证) 提交于 2019-12-03 08:30:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to create a google map with custom icon markers. I need to be able to add dynamic text to the actual marker. In other words is there anyway to add a div? I need to add prices from xml to the actual marker.. I hope this makes sense. ANY HELP would be greatly appreciated or if anyone can point me in the right direction. Thanks! MY JQUERY: function addMarker() { for (var i = 0; i < markers.length; i++) { // obtain the attribues of each marker var lat = parseFloat(markers[i][0]); var lng = parseFloat(markers[i][1]); var trailhead

google maps - using map.fitBounds (bounds);

匿名 (未验证) 提交于 2019-12-03 08:30:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm new to javascript and still finding the google maps javascript a bit confusing. I have the following code (Bottom), it's javascript imbedded in php to create my google map with a bunch of markers. So I want to set the zoom to a level where it will show all my markers. I understand I need this code: var latlngbounds = new google.maps.LatLngBounds(); for (var i = 0; i < latlng.length; i++) { latlngbounds.extend(latlng[i]); } map.fitBounds(latlngbounds); To set the boundary, but I can't figure out where I should put this or what changes I

How does the Google Maps API work with AngularJS?

匿名 (未验证) 提交于 2019-12-03 08:28:06
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How is it possible to use the Google Maps API with AngularJS? I am using this code in my AngularJS app: <style> #googleMap { width: 200px; height: 200px; } </style> <div id="googleMap"></div> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js"></script> <script language="javascript"> var map; function initialize() { var mapOptions = { mapTypeId: google.maps.MapTypeId.ROADMAP, zoom: 8, center: new google.maps.LatLng(-34.397, 150.644) }; map = new google.maps.Map(document.getElementById('googleMap'), mapOptions); }

Infowindow help on google maps api 3

匿名 (未验证) 提交于 2019-12-03 08:28:06
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Having similar problem as others have had on this website where it shows only the last marker's info window info in all markers. Can't seem to solve this with any of the solutions given. Also, the last one of my markers doesn't show an info window at all. <script src = "http://www.google.com/jsapi" ></script> <script type = "text/javascript" src = "data2.json" ></script> <script type = "text/javascript" src = "js/markerclusterer.js" ></script> <script type = "text/javascript" > google . load ( 'maps' , '3' , { other_params :

Google Maps : Show Map Via Address

匿名 (未验证) 提交于 2019-12-03 08:28:06
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have this Code To show map on a page var _map = new GMap2($get("gmap")); var _latLng = new GLatLng(lat, lng); _map.setCenter(_latLng, 11); _map.addControl(new GLargeMapControl()); _map.addControl(new GMapTypeControl()); var _icon = new GIcon(G_DEFAULT_ICON); var marker = new GMarker(_latLng); _map.addOverlay(marker); But I do Not have GeoCode for Some Address. How can I show Map via Address Only. 回答1: You use the GeoCoder to get the address into latitude and longitude first, and then use that. Here's an example of how to geocode an address