google-maps-api-3

HTML 5 Geolocation not working with Directions API

北战南征 提交于 2020-01-26 04:34:25
问题 I am trying to use the geolocations API with the Directions service but I get: var UserLoc; if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { var lat=position.coords.latitude; var lng=position.coords.longitude; console.log(lat); console.log(lng); UserLoc = new google.maps.LatLng(lat,lng); var NewMarker = new google.maps.Marker({ position: UserLoc, draggable: false, animation: google.maps.Animation.DROP, map: SEVTmap }); } ); } else { alert ( "Възникна

How to set Google maps marker size dynamically

。_饼干妹妹 提交于 2020-01-26 04:12:19
问题 I am trying to size my marker by zooming, but it seems not to work here is the code for a better overview: function Icon(url) { this.url = url; this.scaledSize = new google.maps.Size(30, 30); // scaled size //this.origin = new google.maps.Point(0,0); // origin //this.anchor = new google.maps.Point(0, 0); // anchor } var icon1 = new Icon('img/marker-test.png'); map.addListener('zoom_changed', function() { if(map.zoom === 18){ //marker.setIcon(test); console.log('check'); marker.scaledSize =

Hide particular marker google maps api

 ̄綄美尐妖づ 提交于 2020-01-26 04:11:05
问题 Using current code for google maps api i found on stackoverflow, i need to hide all markers except one clicked how can i do it? Not even sure how to approach it? I think it has to do with JS closures however not an expert on that. <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <title>Google Maps Multiple Markers</title> <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> </head> <body> <div id="map

create event listener to dynamically created google-map marker

南楼画角 提交于 2020-01-26 04:03:28
问题 I am trying to create a page that I am going to integrate with excel with vba. . I want to add event Listener to marker when it is clicked. I can barely manage to create a "click listener" to single marker ,but I couldn't do it to multiple markers that are created dynamically using a loop. When the marker is clicked, I want the street view to update to the new clicked marker's position. I really appreciate any suggestion. Thank you. This is what I have(from here and there). <!DOCTYPE html>

create event listener to dynamically created google-map marker

倖福魔咒の 提交于 2020-01-26 04:03:04
问题 I am trying to create a page that I am going to integrate with excel with vba. . I want to add event Listener to marker when it is clicked. I can barely manage to create a "click listener" to single marker ,but I couldn't do it to multiple markers that are created dynamically using a loop. When the marker is clicked, I want the street view to update to the new clicked marker's position. I really appreciate any suggestion. Thank you. This is what I have(from here and there). <!DOCTYPE html>

google api geolocation sample security error

两盒软妹~` 提交于 2020-01-25 20:40:07
问题 I want to show the map here by google map api in local environment. I used the google api geolocation sample, I have successfully showed the map in IE, but I could not show it in google chrome. <!DOCTYPE html> <html> <head> <title>Geolocation</title> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <style> html, body { height: 100%; margin: 0; padding: 0; } #map { height: 100%; } </style> </head> <body> <div id="map"></div> <script> // Note: This

Google Maps V3 removing event listener not working

北城余情 提交于 2020-01-25 20:35:12
问题 I am plotting a number of polygons from an array and then adding three event listeners to each one; mouseover, mouseout and click all of which are working as expected and only effecting the specific polygon. What I need is to disable the mouseout event when a click event occurs so that the colour change which occurs with the click is not removed by the mouseout. Having read lots of posts here and in other places I have tried adding a handle to the mouseout event listener and then adding

count markers displayed on map after zoom in and out

北城余情 提交于 2020-01-25 12:39:33
问题 I am using google-maps-utility-library-v3. I am trying to zoom in and zoom out, if the dot is not in screen anymore, I want to see count 0. But it doesn't work. If I comment out mgr.addMarkers(markers,5); It works.... But it will always be 0 because no maker is managed by the manager. Could someone tell me why? <!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0;

Android Add Map Marker Error: java.lang.IllegalStateException: Not on the main thread

╄→尐↘猪︶ㄣ 提交于 2020-01-25 12:10:12
问题 I'm subscribing to a data stream that gets pushed coordinates, I want to place a marker on the map every time the listener gets a new point. What do I need to do to put the drawMarker code on the correct thread or in the correct scope? @Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; enableMyLocation(); subscribe(); } public void drawLatestPoint(LatLng p) { System.out.println(p); mMap.addMarker(new MarkerOptions().position(p).title("Marker in Sydney")); } private void

Android Add Map Marker Error: java.lang.IllegalStateException: Not on the main thread

Deadly 提交于 2020-01-25 12:10:10
问题 I'm subscribing to a data stream that gets pushed coordinates, I want to place a marker on the map every time the listener gets a new point. What do I need to do to put the drawMarker code on the correct thread or in the correct scope? @Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; enableMyLocation(); subscribe(); } public void drawLatestPoint(LatLng p) { System.out.println(p); mMap.addMarker(new MarkerOptions().position(p).title("Marker in Sydney")); } private void