google-maps-api-3

Change icon back to default state after infoWindow closed Google Maps

拜拜、爱过 提交于 2021-02-17 06:52:19
问题 So my goal here is to make the icon go from the "normalIcon" state to the "activeIcon" state on button click, which it currently does. It opens an infoWindow when the pin is clicked as well. I want the icon to go back to the "normalIcon" state when the infoWindow is closed. Right now, if you click on a different location it changes the icon back to the "normalIcon" but you have clicked on another icon which is now the "activeIcon" Here is the javascript I have: var normalIcon = 'Pin.png'; var

Googlemap Api V3 Catch event

廉价感情. 提交于 2021-02-17 05:33:14
问题 How do I catch if map type was changed? catch if maptype id = roadmap/satellite/hybrid/terrain catch if streetview was used 回答1: Both of these are pretty straightforward - you simply listen to the proper events: Map Type Changed: google.maps.event.addListener(map, 'maptypeid_changed', function() { console.log("map type changed"); }); Streetview Activated: var pano = map.getStreetView(); google.maps.event.addListener(pano, 'visible_changed', function() { if (pano.getVisible()) { console.log(

Change google map marker icon when clicking button inside infowindow

前提是你 提交于 2021-02-11 17:01:08
问题 I have multiple markers on the map that I have imported from JSON. Inside the marker infowindow I have a button and when clicking on that, I want to change the marker image. Please check my code below. Marker list and Infowindow is working fine. I just want to do some actions on the button that is inside infowindow. var workerlist; var jobprice; var price; var map; var list; var position; var image; var image1; var marker; function myMap() { var mapProp= { center:new google.maps.LatLng(30

Google Maps GroundOverlay

风流意气都作罢 提交于 2021-02-11 15:38:13
问题 I am attempting to get a Google maps GroundOverlay working without luck. Searched everywhere, read the Google reference documentation, still no lucK. What I have attempted can be seen at: http://www.ryecemetery.com.au/locate.html Very basic code: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Test</title> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB_SJakjgkzjvWoMu7T-DqsUDWUEbfUtTA"></script> </head> <body> <div style="width: 1200px;

Google Maps GroundOverlay

£可爱£侵袭症+ 提交于 2021-02-11 15:36:39
问题 I am attempting to get a Google maps GroundOverlay working without luck. Searched everywhere, read the Google reference documentation, still no lucK. What I have attempted can be seen at: http://www.ryecemetery.com.au/locate.html Very basic code: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Test</title> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB_SJakjgkzjvWoMu7T-DqsUDWUEbfUtTA"></script> </head> <body> <div style="width: 1200px;

How to enable location on Android in program code?

大兔子大兔子 提交于 2021-02-11 06:42:58
问题 I would like to enable the location settings on an android machine. In my program I check if the LocationManager lm = (LocationManager) getSystemService(LOCATION_SERVICE); if (!lm.isProviderEnabled(LocationManager.GPS_PROVIDER)) { ..// } If deactive, I would like to activate it programatically. EDIT: When my location settings are disabled and I call/use googleMaps, I am asked by means of a dialog, whether I want to enable it? If "Yes", the location service is being enabled in the background

Toggle kml layers in Maps API

瘦欲@ 提交于 2021-02-10 20:42:00
问题 I am trying to now add the ability to toggle kmls with checkbox options for users to add kmls to a map that already has a couple of kmls loaded by default. I used this posts suggestions which has much in common with other posts of this variety to expand on my own script - Toggle multiple KML/KML layers in google maps API v3 But adding it in a pretty straightforward way doesn't work. Does anyone have any suggestions? Thanks for looking. <script src="https://maps.googleapis.com/maps/api/js?v=3"

Toggle kml layers in Maps API

我们两清 提交于 2021-02-10 20:37:15
问题 I am trying to now add the ability to toggle kmls with checkbox options for users to add kmls to a map that already has a couple of kmls loaded by default. I used this posts suggestions which has much in common with other posts of this variety to expand on my own script - Toggle multiple KML/KML layers in google maps API v3 But adding it in a pretty straightforward way doesn't work. Does anyone have any suggestions? Thanks for looking. <script src="https://maps.googleapis.com/maps/api/js?v=3"

Markers not showing on google maps

假装没事ソ 提交于 2021-02-10 06:13:31
问题 I'm trying to show markers on my map. but it's not showing them. this is the code I use: var map; var markers = new Array(); function initialize() { var mapOptions = { zoom: 12, center: new google.maps.LatLng(27.9881, 86.9253), }; var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); google.maps.event.addListener(map, 'click', addMarker); } function addMarker(event) { markers.push(event.latLng); marker = new google.maps.Marker({ position: event.latLng, map: map });

Google Map API v3: check if geojson feature in data layer is visible

情到浓时终转凉″ 提交于 2021-02-08 08:43:38
问题 I use filters to hide or show features/markers in the Data Layer. I try to check which markers are visible after filtering, and if one property of the feature matches one property of an existing polyline (in another json file); then I decide if I show or hide the polyline also. How to know if a certain marker is visible? 回答1: You could set a custom property on the feature and toggle it as you hide and show the feature: feature.setProperty('visible', false); This would have to be done in