google-maps-api-3

Marker with image and number in google maps api

隐身守侯 提交于 2019-12-21 06:17:40
问题 I am using gmap .. I want to put some marker on the map the marker icon is dynamic, I also want a "Number" to be display with the Icon , Is this possible.. My Code is function putMaker(position, title, title_dis, number, icon_img) { if (!isNaN(number)) var icon = "https://chart.googleapis.com/chart?chst=d_bubble_icon_text_small&chld=ski|bb|" + number + "|FFFFFF|000000"; else var icon = null; var marker = new google.maps.Marker({ position: position, map: map, icon: icon_img, shadow: icon, });

How to refresh the weather layer?

萝らか妹 提交于 2019-12-21 06:16:14
问题 Does anyone know if there is a way to refresh the Weather Layer in Google Maps javascript API? To give a little background, we have an application which stays open in the browser and updates some information on the map every few minutes. We let the users open the weather layer on the map, but the weather only loads once, when the layer is created. After a while, it gets outdated and we'd like it to stay current. I've tried everything from recreating the layer and setting the map to null, then

How can I create custom events for google maps api v3 objects?

心不动则不痛 提交于 2019-12-21 06:09:54
问题 I want to make a specialized type of polygon object that wraps around or inherits from the google.maps.Polygon class. I want it to have a custom edited event that can be listened to, ideally via the normal addListener interface. Can this be done? 回答1: I like JustinY's answer. An alternative would be manually triggering an event like this: function CustomPolygon(options) { var self = this; // initialize any options console.log('init') } function edit() { // do work!!! // now tell people about

Google Maps and Their Markers

荒凉一梦 提交于 2019-12-21 05:49:11
问题 I have a JSON array of Marker positions being pulled into a Google map - This works fine. I also have infoWindows linked to each of those markers - These also work fine. However, when I click a marker (in any browser), the infoWindow only appears over the last added marker. Here is a fiddle: http://jsfiddle.net/neuroflux/8WDwn/10/ and here is my loop: for (var a = 0; a < dealer_markers.length; a++) { var tmpLat = dealer_markers[a].lat; var tmpLng = dealer_markers[a].lng; var tmpName = dealer

Get placeId on google maps when POI is clicked

独自空忆成欢 提交于 2019-12-21 05:47:10
问题 I'm using Google Maps JS V3 API on my website. I'm able to use getDetails by placeId when user searches for a place. I would like to do the same when user clicks on a POI. However, I can't seem to find a way to get this placeId when user clicks on a POI instead of using the search box. I have done research for days, and had no luck of finding anything close. I came across this feature request, I wonder if there is really no way of getting the placeId by POI clicking: https://code.google.com/p

Reactjs react-google-maps undefined

雨燕双飞 提交于 2019-12-21 05:04:51
问题 I am working with the react-google-maps package https://github.com/tomchentw/react-google-maps and https://www.npmjs.com/package/react-google-maps. I have an error that says: ./src/App.js Line 31: 'google' is not defined no-undef Line 32: 'google' is not defined no-undef Line 37: 'google' is not defined no-undef Line 42: 'google' is not defined no-undef Line 44: 'google' is not defined no-undef and heres my line in the error: state = { origin: new google.maps.LatLng(41.8507300, -87.6512600),

How to calculate zoom URL parameter at the Google Maps Preview (new version GM)?

此生再无相见时 提交于 2019-12-21 05:03:30
问题 I need to write chrome extension which references on new version of Google Maps site. BUT, in new google maps preview i can not give link becouse i can't calculate new zoom parameter. For example, URL new google maps: https://www.google.com/maps/preview#!data=!1m4!1m3!1d4112402!2d-62.7728736!3d44.829016 new zoom parameter are very strange: zoom 23 http://google.com/maps/preview#!data=!1m4!1m3!1d 1145 !2d29.6765085!3d59.868445 ... zoom 12 http://google.com/maps/preview#!data=!1m4!1m3!1d 77910

Rendering polygon with Google Static Maps API URL

与世无争的帅哥 提交于 2019-12-21 05:01:01
问题 I created a script to store dynamic map inputs by appending attributes to a Static Maps URL (so we can refer back to it after a user submits). For reasons I can't yet determine, the Polygon is not rendering at all with the basic static maps URL, but it works with a 3rd party site's static maps function. According to Static Maps API examples there should be no issue, but I can't seem to recreate the Polygon. Working version (with same attributes in URL, though it ignores Satellite and zoom

What's the most efficient way to create routes on google maps from gps files?

∥☆過路亽.° 提交于 2019-12-21 04:52:26
问题 I want to display my bicycle routes on Google maps. All the coordinates are recorded by my GPS and stored in .gpx file format. I'd like to know what's the best approach/file formats/storage/loading the coordinates on Google Maps. This is a good example but it doesn't seem to be working. 回答1: You may be interested in checking out the following article, fresh from the Google Geo Developers Blog: Map your data with the Maps API and Fusion Tables Quoting the introduction: If you have ever tried

Using google street view with a marker, how do I point the POV at a marker?

ぃ、小莉子 提交于 2019-12-21 04:49:03
问题 I have a simple street view working to show me a street view given an address: var geocoder = new google.maps.Geocoder(); var address = "344 Laguna Dr, Milpitas, CA 95035"; geocoder.geocode( { 'address': address}, function(results, status) { //alert (results); if (status == google.maps.GeocoderStatus.OK) { //alert(results[0].geometry.location); myStreetView = new google.maps.StreetViewPanorama(document.getElementById("map_canvas")); myStreetView.setPosition(results[0].geometry.location); var