google-maps-api-3

Google Maps API (JS) Create a route using PlaceId in waypoints

和自甴很熟 提交于 2019-12-22 04:42:07
问题 The route create only if I use LatLng or String params but I need create it by PlaceId but it doesn't work example: directionsService.route({ origin: {'placeId': 'ChIJc1lGdwfP20YR3lGOMZD-GTM'}, destination: {'placeId': 'ChIJdTGhqsbP20YR6DZ2QMPnJk0'}, waypoints: [{stopover: true, location: new google.maps.Place('ChIJRVj1dgPP20YRBWB4A_sUx_Q')}], optimizeWaypoints: true, travelMode: google.maps.TravelMode.DRIVING } 回答1: Just need to pass the google.maps.Place object as the waypoint location. For

Google Places API: How to use multiple types?

十年热恋 提交于 2019-12-22 03:25:20
问题 I need a POI API that returns ratings, photos, opening/closing times, etc and I thought Google Places API seemed to do what I want, but I am having some trouble with filtering: I want to use the autocomplete feature with multiple types for filtering. Here is what I have: var map; var selectAttractionAutocomplete; var selectCityAutocompleteOptions = { types: ['(cities)'] }; map = new google.maps.Map(document.getElementById('map-canvas'), { center: new google.maps.LatLng(-33.8665433, 151

Qt and Google Earth API

隐身守侯 提交于 2019-12-22 03:16:31
问题 Is it possible to develop an application in Qt, using Google Earth? For example, I want to show the earth (as in google earth) as a sphere via QtGL in my application. 回答1: It is obvious that you can use google earth api with Qt. And I want to share a secret(!!!). Google earth is developed with Qt. :D Here you can find some people discussing about google earth and Qt. Here is some anothe example. 回答2: You could start by looking at the GE Api here. There is a discussion on embedding Google

Adding info windows to multiple circle overlays

守給你的承諾、 提交于 2019-12-22 01:40:41
问题 I am having trouble adding an info window to each one of multiple circle overlays. When I click on a circle an info window appears, but not on the circle I clicked but rather on the last circle added. It seems that each time the loop executes the event listener is added to every circle but the content of the info window is derived from the last circle added. for (i in cityPoints) { var magnitudeOptions = { map: map, center: cityPoints[i].center, radius: cityPoints[i].magnitude, id:cityPoints

Google Maps Api v3: How to change the Default waypoint markers in the Directions (set)Panel?

和自甴很熟 提交于 2019-12-22 01:29:43
问题 How do you change the markers with custom markers active in the map in the directions panel and change the color aswell from the body? Any help much appreciated. The screenshot: http://i.stack.imgur.com/wYFoc.png 回答1: Just to keep alive @MrUpsidown comment and code alive: Short answer: you can't. Longer answer: don't use the directions panel. Create your own, with the information you need (from the directions service response) and add your custom markers. Nov 24 at 16:32 Fiddle var

Can't save waypoints in Google maps v3

旧街凉风 提交于 2019-12-22 01:26:12
问题 I downloaded this project: http://vikku.info/programming/google-maps-v3/draggable-directions/saving-draggable-directions-saving-waypoints-google-directions-google-maps-v3.htm To se how to save waypoints, I opened, the html, and tryied to save the waypoint, but it don't work, I dont know if i need to do something in SQL or not, I just tryied to make it works, please help me if you had sucess to make it works. 回答1: You have to: create a DB with the name mapdir create a table with the name

Cannot read property 'open' of undefined. Google Maps infowindow Loop

删除回忆录丶 提交于 2019-12-22 01:22:41
问题 I'm using Google Maps API to generate a Map with a few markers, each one has a infowindow. All of the neccessary details (lattitude, longtitude) are printed in the HTML, I used JS loop in order to get those values in order to create the markers and the infowindow. The map generates fine but when I click on a markers I get "Uncaught TypeError: Cannot read property 'open' of undefined" when it's supposed to open an infowindow HTML: <select> <option class="markerobject" data-title="Headquarters"

Google Maps API v3 - change strokeWeight of polylines for different zoom levels

删除回忆录丶 提交于 2019-12-22 01:22:08
问题 I have use Google Maps API v3 to create polylines representing trails on numerous maps. There are multiple polylines on each map. When zoomed out I would like the polylines to have a lighter strokeWeight, but heavier when zoomed in. I tried adding a zoom change listener and have it change a variable value for the strokeWeight, but it doesn't appear to work. I need Google to somehow redo the google.maps.Polyline({...}). Also, I need to do this globally, as I said, I have many polylines on each

Google Maps MarkerClusterer either doesn't work or hides all markers

情到浓时终转凉″ 提交于 2019-12-22 01:03:51
问题 ...depending on where I put the line var mc = new markerclusterer(map); If it goes where the examples seem to suggest - right after "var map" is introduced - all the markers disappear (example running here). A version without the mc variable runs with all markers visible. When the mc variable is introduced after the google.maps.event.addListener function as shown here, it seems also to cancel its effect and markers are shown. The locations variable is an array containing geolocation data and

How to get geocode latitude and longitude from json google map api in variables by javascript?

心不动则不痛 提交于 2019-12-22 00:33:18
问题 JSON GEO LOCATION https://maps.googleapis.com/maps/api/geocode/json?address=KOLKATA&key=API_KEY { "results" : [ { "address_components" : [ { "long_name" : "Kolkata", "short_name" : "Kolkata", "types" : [ "locality", "political" ] }, { "long_name" : "Kolkata", "short_name" : "Kolkata", "types" : [ "administrative_area_level_2", "political" ] }, { "long_name" : "West Bengal", "short_name" : "WB", "types" : [ "administrative_area_level_1", "political" ] }, { "long_name" : "India", "short_name" :