google-maps-api-3

How do you return a latitude and longitude array using the Google Javascript v3 Geocoder? [duplicate]

僤鯓⒐⒋嵵緔 提交于 2019-12-25 02:57:31
问题 This question already has answers here : Accessing array from outside of geocode loop (2 answers) How do I return the response from an asynchronous call? (36 answers) Closed 6 years ago . I'm trying to create a function that utilizes Google Javascript V3's geocoding capabilities and returns an array with the longitude and latitude. For some reason the return array is not being populated using the function. Thanks for your help! Code: function getCoords(address) { var latLng = []; var geocoder

It´s a way to set multiple color paths in Google Static Map?

☆樱花仙子☆ 提交于 2019-12-25 02:54:19
问题 Right now i have a dynamically generated google static map image with a path drawed in it. That path it´s composed by 'x' number of separated paths, and i want to set a different color for each one, but i can´t find a way to do that, (if it´s possible). I´m working in PHP. Now i have something like this: http://maps.google.com/maps/api/staticmap?center=' . $latitude . ',' . $longitude . '&zoom=15&format=jpg&size=640x640&scale=4&maptype=hybrid&markers=icon:http://myweburl/myownmarkerimage.png

React Google Maps not displaying HeatMap , lat and long not working for my positions

那年仲夏 提交于 2019-12-25 02:54:01
问题 This what i want, each marker to be sharing the same position as the lat and lng as the heatmap, the markers are working perfectly Im having problems sending data towards my heatmap, it seems like The heatmap from google receives and latitude and longitude differently than the markers positions? any idea ? when i create an array of list of objects like this but i want my data read just like my markers is reading it. It receive M for latitude and N for longitude. If i put a it inside a wrapper

Google maps API key HTTP restriction causes 403 error in geocoding API

二次信任 提交于 2019-12-25 02:46:20
问题 I receive a 403 error in google maps API dashboard for the geocoding API after limiting the key to my domain. The geocoding works when the key is unrestricted. Currently I have the following as acceptable HTTP referrers: https://website.com/* https://www.website.com/* This allows my basic javascript map and autocomplete forms to work on HTML pages. However, the geocoding is done through a python script that accesses website.com/markers (has no HTML page, just displays JSON data if you visit

Setting a Info window for google map markers located on route (start and End Points)

我怕爱的太早我们不能终老 提交于 2019-12-25 02:45:06
问题 Hi i'm drawing a route here in my code between two markers. what i need to get done is adding a click event to those two markers and setting a info window to each marker. i searched on many websites couldn't find a solution. though it draws the route between markers cannot set a info window to each marker. Here is my Code... function mapLocation() { var directionsDisplay; var directionsService = new google.maps.DirectionsService(); var map; function initialize() { directionsDisplay = new

All infowindows have same data

被刻印的时光 ゝ 提交于 2019-12-25 02:29:52
问题 im fairly new to the Google Maps V3 API and i'm running into an issue where all infowindows have the same data, the code im using iterates through an array of marker details and outputs the marker plus an infowindow for each marker. This is my code: <script type="text/javascript"> (function () { google.maps.Map.prototype.markers = new Array(); google.maps.Map.prototype.addMarker = function(marker) { this.markers[this.markers.length] = marker; };})(); function initialize() { var latlng = new

how to change polyline color by clicking on it?

女生的网名这么多〃 提交于 2019-12-25 02:22:10
问题 i am using drawnig tools provided by google maps api, and i want after drawnig the polyline, to change its color by clicking on it this is my code function initialize() { var mapOptions = { center: new google.maps.LatLng(-34.397, 150.644), zoom: 8 }; var map = new google.maps.Map(document.getElementById('map-canvas'),mapOptions); var drawingManager = new google.maps.drawing.DrawingManager({ drawingMode: google.maps.drawing.OverlayType.MARKER, drawingControl: true, drawingControlOptions: {

Changing Google Maps V3 Maker Icon the correct way?

别来无恙 提交于 2019-12-25 02:16:07
问题 The code in example 1 works. I would like to understand the marker.setIcon(); function more (new to JavaScript also). My question is. In the documentation for Google maps you see something like this for changing the marker. MarkerImage(url:string, size?:Size, origin?:Point, anchor?:Point, scaledSize?:Size) How does this relate to what I have done in example 1 for setting up marker Icon, shoud I have done somethign like this instead? marker = google.maps.MarkerImage({ url: "newIcon.png" });

Gmap api3 and bootstrap = grey block

血红的双手。 提交于 2019-12-25 02:14:07
问题 I'm updating some old code to Google Maps API v3, and I can't get the map to show anything. Dumping the map object to the console shows the map has been initialized properly and it is supposed to be loading in the proper div-- but nothing shows except a grey box. I have set width/height and overflow for the map div, since this seems to be the most common problem. However, I can't get this to work. Any ideas? http://jsfiddle.net/Nbjrf/1/ Thanks 回答1: You had the mapTypeId constant in quotes,

Place map with transparent bg over another one

吃可爱长大的小学妹 提交于 2019-12-25 02:14:00
问题 I'm looking to place one map over another so that I can make one "satellite view" map dark without affecting the color of roads and labels. I want it to look like this: http://pixfx.at/#Map So I took some of their code and made it look like this: <style type="text/css"> #map { height:543px !important; background-image:url(../images/background_gradient_transparent.png); background-repeat:repeat-x; border-top:1px solid #cccccc; border-bottom:1px solid #666666; margin:5px 0px 5px 0px; overflow