google-maps-api-3

How can I get directions for multiple waypoints with different transit methods using the Google Directions Service?

陌路散爱 提交于 2019-12-22 07:00:25
问题 So I understand how to use the Google Directions service to add waypoints and to change the transit mode but is it possible to do both with the same API call? I'm trying to get directions that will involve walking, then biking, and then some more walking but I'm not sure how to do it using one API call. I know I can split it up into a few but it will then force me to process Google's response vs using the setDirections method. These are the docs I'm going from: https://developers.google.com

Google places autocomplete inside a react component

前提是你 提交于 2019-12-22 06:58:08
问题 I am trying to build a google map component and everything is working fine with the Google Maps API v3 but not the Autocomplete functionality. This is the code I am using: The Google Map component import React, {Component} from 'react'; import ReactDOM from 'react-dom'; const Marker = React.createClass({ componentDidMount: function() { console.log("Marker on mount"); }, render: function() { return false; } }); export default Marker; const GoogleMap = React.createClass({ componentDidMount:

Demo for Displaying Multiple Google Directions (Google Maps API v3)

泄露秘密 提交于 2019-12-22 06:53:58
问题 Hey all, is there a functioning demo out there for displaying multiple directions routes on a single Google map? The other question on stack links to a set of snippets…I feel like I'd be able to work better I just saw a functional script in action. Thanks much! 回答1: Using the snippets from the other post, I got what I wanted. Not only did I achieve multiple directions displays on the same map, but there are also unique waypoints to each directions object. Link to the demo 来源: https:/

Google Map API BackBoneJS Cannot read property 'offsetWidth' of null

痞子三分冷 提交于 2019-12-22 06:41:21
问题 I've been through as many StackOverflow/google groups as I can imagine trying to figure this guy out. I'm using BackboneJS to render a map that has a start location and an end location. On a fresh page/page refresh, I don't get this error, and the map and stuff work fine, for I am using jQuery's $(window).load(.....) function; however, when I dynamically render my View, I get this error-I believe-because the DOM hasn't loaded the DIV yet (failing with document.getElementById). I have tried

Google Maps geocode api inconsistencies

旧城冷巷雨未停 提交于 2019-12-22 06:28:15
问题 I'm trying to geocode this address "188th street & third avenue, bronx NY" If you run this geocode query through the maps api v3 geocoder, you get back 10 or so results, none of which are in new york. http://maps.google.com/maps/api/geocode/xml?sensor=false&address=188th%20street%20&%20third%20avenue,%20bronx%20NY If you paste that same address into google maps, it takes you directly to the intersection in the bronx. Is there a reason these results are inconsistent, and is there a way I can

Google Maps - Resource interpreted as Script but transferred with MIME type image/png

夙愿已清 提交于 2019-12-22 05:42:15
问题 I did some research and I couldn't find a post that was specific to the Google Maps V3 Javascript API, so I'm posting a new question. Please let me know if there is a more appropriate place for this question. My Issue: Without touching anything, my website, utilizing the Google Maps V3 Javascript API, started giving me this error: Resource interpreted as Script but transferred with MIME type image/png Refused to execute script from 'http://mt1.googleapis.com/vt?pb=!1m4!1m3!1i15!2i9148!3i11958

Google Maps doesn't load the 2nd time - AngularJS

落爺英雄遲暮 提交于 2019-12-22 05:24:33
问题 I'm using the GoogleMap API ('angular-google-maps' js package) and I have a very weird behavior. The first time I load it, i get the full map loaded, like here: Then i close the dialog and reopen it, i see this: Keep in mind, that the map is displayed as a dialog on top of another dialog. Any ideas? 回答1: If you are using Angular Google Map module you must add the refresh attribute to the googlemap element. As it written in the Module documentation: refresh = "expression" - Expression which,

Google Maps doesn't load the 2nd time - AngularJS

◇◆丶佛笑我妖孽 提交于 2019-12-22 05:24:13
问题 I'm using the GoogleMap API ('angular-google-maps' js package) and I have a very weird behavior. The first time I load it, i get the full map loaded, like here: Then i close the dialog and reopen it, i see this: Keep in mind, that the map is displayed as a dialog on top of another dialog. Any ideas? 回答1: If you are using Angular Google Map module you must add the refresh attribute to the googlemap element. As it written in the Module documentation: refresh = "expression" - Expression which,

Height/Elevation of a pixel from ground in Google Street View

一曲冷凌霜 提交于 2019-12-22 04:59:28
问题 I am looking to find the height of every pixel from ground in the google street view. Couple of things I know can be calculated are: Pitch of a pixel Depth map of every pixel from camera There is a javascript library to fetch depth map too. Is it possible to put the two together to calculate actual height of a pixel from ground? 回答1: If we know the height of the camera then this becomes a simple matter of trigonometry. tan(angle) = height-above-camera / depth so height-above-camera = depth *

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

别等时光非礼了梦想. 提交于 2019-12-22 04:42:31
问题 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