google-maps-api-3

google map custom marker with base64 string

自作多情 提交于 2020-03-25 04:07:07
问题 I have tried quite a few ways to load my base64 string image as a google map custom marker in Chrome. This: var marker = new google.maps.Marker({ position: latLng, map: map, title: 'hello', id: 'the id', icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAA..." }); As recommended here, cause my image to cover the top half of my 800x400px map. So I figured I had to re-size the image and did the following, and no image displays. var my_marker = new Image(30, 30); $(my_marker).attr('style

React and google-maps-react. Not displaying InfoWindow

≡放荡痞女 提交于 2020-03-24 12:07:14
问题 I am using React and google-maps-react library for a project. I am trying to display InfoWindows for each of the markers. But it is not working. I have looked at the documentation as well as GitHub issues for this and have no been able to find a solution. Here is the code import React from "react"; import { connect } from "react-redux"; import { Map, GoogleApiWrapper, Marker, InfoWindow } from "google-maps-react"; import { API_GOOGLE_MAPS } from "../config"; const mapStyles = { width: "100%",

React and google-maps-react. Not displaying InfoWindow

我的梦境 提交于 2020-03-24 12:05:52
问题 I am using React and google-maps-react library for a project. I am trying to display InfoWindows for each of the markers. But it is not working. I have looked at the documentation as well as GitHub issues for this and have no been able to find a solution. Here is the code import React from "react"; import { connect } from "react-redux"; import { Map, GoogleApiWrapper, Marker, InfoWindow } from "google-maps-react"; import { API_GOOGLE_MAPS } from "../config"; const mapStyles = { width: "100%",

Getting external markers for a new google map

心已入冬 提交于 2020-03-24 00:17:35
问题 I need to create an instance of a Google map that uses markers from an external Google Map. More specifically I need to grab all the markers from the "source map", run some algorithms and filtering and them add them to my newly created Google Map. I've tried searching both the Google Maps API and forums for clues, but most of them are about getting markers from the current map, and not externally. Do I need to use the KML source somehow? Thanks in advance! 来源: https://stackoverflow.com

Rounding a number to one decimal in javascript [duplicate]

可紊 提交于 2020-03-22 03:40:16
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How do you round to 1 decimal place in Javascript? The following code, displays the total distance covered, on a particular route, displayed on google maps. I managed to convert the number from kilometers to miles. Here is the code for the function: function computeTotalDistance(result) { var total = 0; var myroute = result.routes[0]; for (i = 0; i < myroute.legs.length; i++) { total += myroute.legs[i].distance

How to add marker on map by Click using react-google-maps?

房东的猫 提交于 2020-03-18 05:05:32
问题 I'm struggling to find a very simple example of how to add a marker(s) to a Google Map when a user left clicks on the map using React-google-maps in components based. Need help. const Map = withScriptjs(withGoogleMap((props) => <GoogleMap defaultZoom={8} defaultCenter={{ lat: -34.397, lng: 150.644 }} onClick = {props.onMapClick} > {props.isMarkerShown && <Marker position={props.markerPosition} />} </GoogleMap> )) export default class MapContainer extends React.Component { constructor (props)

Current location marker in browser (blue circle) [duplicate]

三世轮回 提交于 2020-03-17 11:14:35
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to highlight a user's current location in google maps? Is there any method to get blue circle marker in current location using javascript google maps api? 回答1: You can use the GeolocationMarker library. It is part of the Google Maps API Utility Library. 回答2: Use the navigator.geolocation approach, and use a custom icon for your blue circle https://developer.mozilla.org/en-US/docs/Using_geolocation https:/

how to get real direction steps using Flutter? (draw real route)

冷暖自知 提交于 2020-03-05 04:14:50
问题 I'm working with taxi app. Is it possible to draw real route on real road using flutter? I used this way: https://developers.google.com/maps/documentation/directions/intro#ExampleRequests getDirectionSteps(double destinationLat, double destinationLng) { network .get("origin=" + location.latitude.toString() + "," + location.longitude.toString() + "&destination=" + destinationLat.toString() + "," + destinationLng.toString() + "&key=api_key") .then((dynamic res) { List<Steps> rr = res; print(res

how to get real direction steps using Flutter? (draw real route)

天涯浪子 提交于 2020-03-05 04:12:52
问题 I'm working with taxi app. Is it possible to draw real route on real road using flutter? I used this way: https://developers.google.com/maps/documentation/directions/intro#ExampleRequests getDirectionSteps(double destinationLat, double destinationLng) { network .get("origin=" + location.latitude.toString() + "," + location.longitude.toString() + "&destination=" + destinationLat.toString() + "," + destinationLng.toString() + "&key=api_key") .then((dynamic res) { List<Steps> rr = res; print(res

animating a map marker using request animation frame in google maps api v3

流过昼夜 提交于 2020-02-23 07:37:29
问题 I've managed to animate a google map marker around a route in google maps api v3 using setTimeout, but I'd like to find a way to do it using request animation frame. However, when I try to do this - the marker just seems to jump from beginning of the path to the end, with no animation. Any ideas where I'm going astray? Here's the relevant parts of my code using setTimeout, but you can also download / view the files in github: self.animateRun = function(curDist){ //moves the runner if (curDist