google-maps-api-3

Display Label for Each Waypoint Pin on Google Map API

痞子三分冷 提交于 2019-12-23 09:36:28
问题 I'm trying to add a label for each waypoint along the route, but I'm not quite sure how I should approach it. After doing some research, I understand that you can add a custom pin with label, but that's when I drop each pin manually. How can I do this for direction? 回答1: If you want to get access to markers from DirectionsRenderer request that need a hack because there is not official way to do this from google map api. There is a way around, here is an example I made: https://jsfiddle.net

Hide specific poi.business on gmap api v3

喜欢而已 提交于 2019-12-23 09:32:26
问题 I succeeded to hide business POI on Google Maps API v3 with this topic. But now I wonder if there is a way to be more specific. I want to hide only hotels POI but still show restaurants and bars POI. Is there a solution ? Thanks 回答1: I don't think there is a way to be more specific. You can refer to the Styled Map Wizard and the documentation to see what you can toggle. 来源: https://stackoverflow.com/questions/21455424/hide-specific-poi-business-on-gmap-api-v3

Find when google places autocomplete returns zero results

a 夏天 提交于 2019-12-23 09:32:09
问题 I use the google places autocomplete for places suggestion. Now this is what I want: when a user types in a location that is not in google's database, that is google returns zero results, I need to be able to capture the event of zero results, and fire my custome autocomplete. How do I find when google is returning zero results? autocomplete.getPlace() will return a status if there are zero results, but this is inside place_changed event, which is fired only when user selects a suggestion

How can I wait for an asynchronously created object to be completely available before invoking a callback?

我只是一个虾纸丫 提交于 2019-12-23 09:29:36
问题 I'm trying to create a function that will create a new marker. I need to be able to process some of the properties of the new marker in the callback. The problem is that marker is immediately created and can be used to invoke the callback, but some properties are not yet available. If I wait two seconds before trying to access the properties, it works just fine - this leads me to believe that the object is still asynchronously generating itself after being created. <!DOCTYPE html> <html>

Is LatLng inside a polygon

人盡茶涼 提交于 2019-12-23 09:04:02
问题 I have a typical polygon set on a google map with some latLng's: var bermudaTriangle = new google.maps.Polygon({ paths: [ new google.maps.LatLng(25.774252, -80.190262), new google.maps.LatLng(18.466465, -66.118292), new google.maps.LatLng(32.321384, -64.75737), ] }); bermudaTriangle.setMap(map); these are the Bermuda Triangle coords from google's documentation. I also have some random coords, saaay: var coord1 = new new google.maps.LatLng(26.194876675795218,-69.8291015625) var coord2 = new

How to use RouteBoxer.js for Google Map on Android

蹲街弑〆低调 提交于 2019-12-23 08:36:52
问题 I have a route. Now, I want to find all nearby markets, for example, around that route. On web version, I use RouteBox library successfully. The problem is I can't use it in Google Map on Android, because it is a javascript library. What can I do now? How can I use that library on Android or do I have a workaround way? 回答1: You can call javascript from your App in Android. You will need to use JS Evaluator for Android (JSEA). Just do something like: jsEvaluator.callFunction(new JsCallback() {

Google maps polyline not rendering perfectly

有些话、适合烂在心里 提交于 2019-12-23 07:31:47
问题 I am drawing polyline using latest google maps API for iOS. I am constructing polyline point by point but it is not rendering properly as when i zoom out the polyline vanishes(not in literal terms) from the map and when i zoom in it simply shows the line. This is how polyline appears when zoomed in This is how it appears when zoomed out here is my function for drawing polyline RCPolyline *polyline = [[RCPolyline alloc] init]; [polyline drawPolylineFromPoint:self.selectedEmployee.location

Google maps not showing up

烂漫一生 提交于 2019-12-23 07:27:51
问题 I have a written a simple code which would display the location on the google map. But for some reasons its not showing up. Any idea whats happening? <html> <head> <title>Google Maps </title> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script> <script type="text/javascript"> (function() { window.onload = function(){ var latlng = new google.maps.LatLng(57.8, 14.0); var options = { zoom: 6, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }

What causes “The Google Maps API server rejected your request. An internal error was found for this API project.”?

断了今生、忘了曾经 提交于 2019-12-23 07:05:07
问题 This is using the Static Maps API. I have a web page with 3 img tags, each of which is a call to the static maps API, (NB of course this is not the real api key). The 3 tags are identical, except the zoom, which is 10, 13 and 16 for the three images. The API Key is from a project with the Static maps API enabled, and billing configured and enabled. I have sent perhaps 60 requests in total (this is a brand new development project, so I'm just getting started). What I'm seeing is that sometimes

Google maps v3 - Add markers at the center of tiles

前提是你 提交于 2019-12-23 07:01:42
问题 function initialize() { var myLatlng; var mapOptions; myLatlng = new google.maps.LatLng(29.98439980, -95.34140015); mapOptions = { zoom: 16, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map( document.getElementById("map-canvas"), mapOptions); google.maps.event.addListenerOnce(map, 'idle', function() { drawRectangle(map); var result = {"regionList":[{"centerLongitude":-95.34890747070312,"imageIcon":"../images/untested-icon.png","centerLatitude":29