maps

'Uncaught InvalidValueError' (: setCenter: not a LatLng or LatLngLiteral object)

匿名 (未验证) 提交于 2019-12-03 02:51:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm starting to know PHP and JavaScript, mixing them in HTML and using Google Maps API (version 3). I figured how to 'put' various markers but the console will throw me an error: " Uncaught InvalidValueError: setCenter: not a LatLng or LatLngLiteral object ". I think it's because the var created in the loop is not exactly the object needed but instead a string, though this confuses me, I don't know if I'm right. I'd appreciate it a lot if anyone could set me in the right path. Thanks in advance. This is my code: (By the way, the array I'm

Google Maps JavaScript API v3 directions capabilities

匿名 (未验证) 提交于 2019-12-03 02:50:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I use Google Maps js API v3. I can show directions with waypoints based on this . What I want is getting the points of the direction. Lets say the direction line goes from Budapest to Warsaw. I want to get all latitude and longitude on that line. But I don't find any build in function or workaround for this. I don't copy code here as the tutorial works for me , I can start from that. (Of course it isn't a good idea to make lot of waypoints.) I've seen this question . It isn't solution for my problem, as its not for API3 Thanks in advance.

Fixed Legend in Google Maps Mashup

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a page with a Google Maps mashup that has pushpins that are color-coded by day (Monday, Tuesday, etc.) The IFrame containing the map is dynamically sized, so it gets resized when the browser window is resized. I'd like to put a legend in the corner of the map window that tells the user what each color means. The Google Maps API includes a GScreenOverlay class that has the behavior that I want, but it only lets you specify an image to use as an overlay, and I'd prefer to use a DIV with text in it. What's the easiest way to position a

Length buffer around polyline

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm not very good at mathematics, so I got a problem. I have a route from one, to another distination. Some time I was trying to apply a colored plot aroud the route in fixed length. But I cant get a nice rounded corners and my lack of math is making me a lot of truble. Now I got this And the code var r = []; var bla = result.routes[0].overview_path; for(i in result.routes[0].overview_path) { r.push(new google.maps.LatLng(bla[i].lat()+z, bla[i].lng()-z)); } bla.reverse(); for(x in bla) { r.push(new google.maps.LatLng(bla[x].lat()-z, bla[x]

Best way to geocode UK postcode with Google Maps API?

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What is the most effective and accurate way to geocode a UK postcode? Using the built in geocode object results in massively blurred results (lots of postcodes returning just a general area). Are there any free UK postcode geocoding services I can plug into via JavaScript? 回答1: Edit: To be clearer this uses the local search in google search api, not the google maps api to do the geocoding which is much more accurate. The best way is to use Google Search Api. If you get an api key and get it all setup: http://code.google.com/apis/ajaxsearch/

Custom routes/paths/roads on Google Maps

匿名 (未验证) 提交于 2019-12-03 02:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Hey guys. I need to know if what I need is achievable. I need to be able to, using either V2 OR V3 (preferably 3), create paths which ignore buildings in a sense. I was trying to create even a kml file to draw out all of the paths myself, and then find some way to turn them on/off as needed. For example. The user wants to go from point A to point B. Between these points is a number of buildings. The user physically CAN walk through these buildings(it's a campus). I want to show them that on the map. This way you don't have to do a loop-de

How to listen for user generated zoom in Google Maps?

匿名 (未验证) 提交于 2019-12-03 02:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to know when a Google Maps zoom_changed event is fired specifically by a user interaction with the +/- zoom buttons. If I use a general event listener for zoom_changed, I can't tell if it is a user-generated event or a zoom change caused by something like fitBounds(). Looking for the best way to do this. I've tried the following things, none of which seem to work: 1) Looked for event information on zoom_changed. There appears to be none. 2) Add listeners for mouseover and mouseout that let me set a flag to see if the user is in the

gmaps v3 get latitude from event.latLng

匿名 (未验证) 提交于 2019-12-03 02:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an old gmaps application using V2 and I am trying to update it to v3. I have a really simple problem, but I can't find a solution yet. How can I strip the latitude and the longitude from the "event.latLng"? It is returning a point() , but I need only the lat alone and the long for itself. I cant get this to work. 回答1: According to the API for MouseEvents , event.latLng contains a LatLng , not a Point . If this is the case then you can use the lat() and lng() methods to get the values separately. If event.latLng is actually a Point

Replacing GTileLayer in Google Maps v3, with ImageMapType, Tile bounding box?

匿名 (未验证) 提交于 2019-12-03 02:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to update this code: radar_layer.getTileUrl=function(tile,zoom) { var llp = new GPoint(tile.x*256,(tile.y+1)*256); var urp = new GPoint((tile.x+1)*256,tile.y*256); var ll = G_NORMAL_MAP.getProjection().fromPixelToLatLng(llp,zoom); var ur = G_NORMAL_MAP.getProjection().fromPixelToLatLng(urp,zoom); var dt = new Date(); var nowtime = dt.getTime(); var tileurl = "http://demo.remoteservice.com/cgi-bin/serve.cgi?"; tileurl+="bbox="+ll.lng()+","+ll.lat()+","+ur.lng()+","+ur.lat(); tileurl+="&width=256&height=256&reaspect=false&cachetime="

Adding Array of Markers in Google Map

匿名 (未验证) 提交于 2019-12-03 02:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need some help in creating an array of markers in Google Map so that it can be more efficient, instead of create a marker one by one. I tried the following but it doesn't work. Anyone have advice? //create array to store a set of location var collection = new Array(); //a set of locations stored in array collection[0] = new google.maps.LatLng(13.742167701649997, 100.50721049308777); collection[1] = new google.maps.LatLng(13.74428, 100.5404525); collection[2] = new google.maps.LatLng(13.744108, 100.543098); var pointMarkerImage = new Array(