google-maps-api-3

Using Longitude/Latitude as Waypoint

一笑奈何 提交于 2019-12-28 04:14:05
问题 I'm trying to use the longitude latitude as a waypoint in my google maps and cant seem to get it working. Here's how I have my values pushed waypts_mtlsheloc.push({ location: (45.658197,-73.636333), //I don't think I'm supposed to write this like that. But can't find the right way. stopover: true }) And then try to modify my line like this service.route({ origin: latlng_mtlsheloc[0], destination: latlng_mtlsheloc[latlng_mtlsheloc.length - 1], waypoints:waypts_mtlsheloc, travelMode: google

How can I modify the markers?

蹲街弑〆低调 提交于 2019-12-28 03:11:27
问题 Im a beginner and I'm trying to lean to code and use google map api v3. I would like to customize the marker of this example that I found on google's developer page. I want to display a different marker for each type (eg: green for restaurants, yellow for hotels) Thank you for your help and apologize for my english. var map, places, iw; var markers = []; var autocomplete; function initialize() { var myLatlng = new google.maps.LatLng(100.365478075776182, 14.3210456439636); var myOptions = {

Google Maps Javascript API v3 Map Label and Polygons

我只是一个虾纸丫 提交于 2019-12-28 03:05:49
问题 I am using the Google Maps javascript API v3 with a project, and I am currently having troubles getting the maplabels to appear above the polygons. I know that the polygons are z-indexed with respect to only themselves (Not able to use the z-index of a maplabel to place the maplabel above it). I was wondering if there was some hack to get around this issue. I am also using the info Window library for the api, and I need the labels to appear above the polygons, but below the info window. 回答1:

Google Maps Javascript API v3 Map Label and Polygons

允我心安 提交于 2019-12-28 03:05:16
问题 I am using the Google Maps javascript API v3 with a project, and I am currently having troubles getting the maplabels to appear above the polygons. I know that the polygons are z-indexed with respect to only themselves (Not able to use the z-index of a maplabel to place the maplabel above it). I was wondering if there was some hack to get around this issue. I am also using the info Window library for the api, and I need the labels to appear above the polygons, but below the info window. 回答1:

Google Maps API - Closest marker function change to closest n markers

眉间皱痕 提交于 2019-12-28 02:18:07
问题 I am using the formula found in this question to find the closest marker on the map to the current position. I would like to modify this formula so that it finds the closet n number of locations(closest 5 locations, closest 10 locations, etc.) and I am not sure how to accomplish this. Here is the modified formula I am using: function rad(x) {return x*Math.PI/180;} function find_closest_marker(center, map) { var lat = center.lat(); var lng = center.lng(); var R = 6371; // radius of earth in km

Trigger event with infoWindow or InfoBox on click Google Map API V3

佐手、 提交于 2019-12-28 02:05:23
问题 I want to know how to trigger an event when I click on an infoWindow using Google Maps API v3. In this example, when I click on a marker, an info window shows up with a unique message, based on which marker I clicked. I want to also be able to click the info window and have an alert show up that says "You clicked on the infowindow for ( __ fill in blank location _ ) I found some examples using Google Maps API v2 and jQuery, but not with just plain old Google Maps API v3. <!doctype html> <html

JS Maps v3: custom marker with user profile picture

放肆的年华 提交于 2019-12-28 02:03:34
问题 I am struggling since 2 days with something I was thinking easy, on a map, I have to display a marker for each user with the user FB profile picture inside. I am wondering how I can have a result similar to this one? What I tried was really hackish. I put the FB picture as the marker icon I put a CSS class on the label of the marker I find the sibling to add this border and this arrow to decorate the user picture but it doesn't work when there is more than one marker on the map. .marker

google.maps.Geocoder.geocode() geometry.location lat/lng property names change frequently

亡梦爱人 提交于 2019-12-27 23:37:08
问题 I have an application, and I'm using the Google Javascript Geocoding API to fetch lat/lng for an address. The code goes something like geocoder = new google.maps.Geocoder() geocoder.geocode({ 'address': query }, function(results, status) { addresses = {}; $.each(results, function(index, value){ addresses[index] = {"lat":value.geometry.location.$a,"lng":value.geometry.location.ab} }) }); All is fine and dandy, but the thing is that the property names of the location object periodically change.

google.maps.Geocoder.geocode() geometry.location lat/lng property names change frequently

冷暖自知 提交于 2019-12-27 23:36:33
问题 I have an application, and I'm using the Google Javascript Geocoding API to fetch lat/lng for an address. The code goes something like geocoder = new google.maps.Geocoder() geocoder.geocode({ 'address': query }, function(results, status) { addresses = {}; $.each(results, function(index, value){ addresses[index] = {"lat":value.geometry.location.$a,"lng":value.geometry.location.ab} }) }); All is fine and dandy, but the thing is that the property names of the location object periodically change.

Google Maps API v3 | shows no map data

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-27 15:58:22
问题 i'm program a small javascript application for our local firefighter home. The application is a little like powerpoint etc. but in html. In this application i would show a google maps map with a route that shows the way from the firefighter home to the fire. I use jquery for requesting the data from the http server. My Problem is that i have inserted the code for the google maps api and the browser shows me the maps object with the google logo and so on. But there is no map, there is only a