maps

Google maps connecting markers

匿名 (未验证) 提交于 2019-12-03 09:05:37
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have hundreds of GPS coordinates (collected by a GPS module in my car) in my database and I am loading them to google maps. Is there some way I can connect these coordinates in same way as google waypoints do (so the connecting line always stays on a road)? 回答1: You would probably want to use the Google Directions Web Service API. You would use something like PHP or Python to do a call between each of the points and then cache the directions on your server. Then serve them out as Polylines on your map. Or you could do it client side, in

Combining Google Maps Geocoder and Leaflet Map Receiving Error: Invalid LatLng object

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using Google Maps Geocoder to grab the latitude and longitude of an address. I'm then taking that address and using Leaflet and panning the map to the latitude + longitude coordinates. However, I'm receiving an error from Firebug saying Error: Invalid LatLng object: (-33.8674869, 151.20699020000006, undefined) . I know my variable geolocation returns -33.8674869, 151.20699020000006 but not the undefined. What's causing the problem? <body onload="initialize()"> <div id="result"></div> <div> <input id="address" type="textbox" value="Sydney

How do I add google map in angular.js controller?

匿名 (未验证) 提交于 2019-12-03 08:59:04
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: So, I'm fairly new to angular and having hard time implementing google map API. I keep getting error: Uncaught InvalidValueError: initialize is not a function. I have this for the script tag: <script src="https://maps.googleapis.com/maps/api/js?key=MY API KEY GOES HERE&callback=initialize" async defer></script> But since my function initialize() is inside my controller, it doesn't recognize it. If I put the function outside of the controller, it does recognize it. But since I have all the data defined within the controller, I need this

Integrating Google Maps to get Current Location in angular 2?

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How do i use google maps API in angular 2 to get Current location ? i've included the google map in my application. now i want to capture current location i've attached my code . Please Help me import { Component,OnInit,ElementRef,ViewChild} from '@angular/core'; // import {searchComponent} from './getLocation.Component'; declare var google: any; @Component({ selector: 'map', moduleId:module.id, templateUrl:'geoCodeMap.component.html', }) export class mapComponent{ searchBox:any; map:any; marker:any; accuracy:any; @ViewChild('mapDiv') mapDiv

Scala: Merge maps by key

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Say I have two maps: val a = Map(1 -> "one", 2 -> "two", 3 -> "three") val b = Map(1 -> "un", 2 -> "deux", 3 -> "trois") I want to merge these maps by key, applying some function to collect the values (in this particular case I want to collect them into a seq, giving: val c = Map(1 -> Seq("one", "un"), 2->Seq("two", "deux"), 3->Seq("three", "trois")) It feels like there should be a nice, idiomatic way of doing this - any suggestions? Am happy if the solution involves scalaz. 回答1: scala.collection.immutable.IntMap has an intersectionWith

Android creating BitmapDescriptor exception

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm writing an application that works alot with google map and markers on it. My task is to create and display some amount of markers on google map. Markers have custom image and text in it. Data is loading from server and i need to display new amount of data every time user moves google map camera. So i'm using android-maps-utils:0.4.3 library for creating custom Bitmap (using IconGenerator) and then create BitmapDescriptor from it. Here is part of the code: googleMap.clear() LayoutInflater layoutInflater = (LayoutInflater) getContext()

Gradient for Fusion Table Layer

匿名 (未验证) 提交于 2019-12-03 08:56:10
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Can anyone explain why the gradient isn't working for the map below? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><title>Riks.txt - Google Fusion Tables</title> <style type="text/css"> html, body, #map_canvas { margin: 0; padding: 0; height: 100%; } </style> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.7&sensor=false"> </script> <script type="text/javascript"> function initialize() { map = new google.maps.Map (document.getElementById('map_canvas'), {

Google Maps - Autocomplete &amp; Directions API - trigger onchange() for dropdown list?

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have Google Map and two inputs. Both of them use autocomplete, like this: //first input autocomplete var input1 = (document.getElementById('start')); var autocomplete1 = new google.maps.places.Autocomplete(input1); autocomplete1.bindTo('bounds', map); //second input autocomplete var input2 = (document.getElementById('end')); var autocomplete2 = new google.maps.places.Autocomplete(input2); autocomplete2.bindTo('bounds', map); After I fill both of these inputs I'm displaying the shortest way betweeen them using Directions API: function

ALL google maps Directions web service API requests with mode=transit return INVALID_REQUEST

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Here are a few URLs that return results with walking or driving but not with transit (i.e., change mode to walking or driving and you will see results) http://maps.googleapis.com/maps/api/directions/json?origin=EC3N4AB&destination=EC4M8AD&sensor=false&mode=transit http://maps.googleapis.com/maps/api/directions/json?origin=Toledo&destination=Madrid&region=es&sensor=false&mode=transit I cant get a single response with mode=transit. Notice that the second URL is straight from API documentation Anyone else noticing the same thing? 回答1: Sorry.

Load JavaScript dynamically [duplicate]

匿名 (未验证) 提交于 2019-12-03 08:52:47
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This question already has an answer here: JQuery to load Javascript file dynamically 2 answers I have a web page and a canvas with Google Maps embedded in it. I am using jQuery on this site. I want to load Google Maps API only if the user clicks on "Show me the map". Further, I want to take away the whole loading of the Google Maps from the header in order to improve my page performance. So I need to load JavaScript dynamically. What JavaScript function I can use? 回答1: You may want to use jQuery.getScript which will help you load the Google