google-maps-markers

javascript - can't remove google map markers

只谈情不闲聊 提交于 2019-12-13 04:47:26
问题 I'm having some trouble with google map markers. I have an array that contains 7 locations. When the page loads, a "for" loop runs through the array and places the first four locations as markers on the map. What I then want to happen is to be able to click the "Remove and add markers" button, which would run a function (called addMarker2) to remove the original 4 location markers and add the last 3 location markers to the map. I've tested the function to only add the last 3 markers, and it

How do I add a title box to a custom google map?

本秂侑毒 提交于 2019-12-13 04:47:25
问题 http://i.stack.imgur.com/6MuEE.jpg I managed to add the custom pointer via google maps, but I am confused how to add that custom title box of the address that is pointing to the pointer, as in the design. Please help me out. Thank you. 回答1: for this, you could use the infobox.js, add the infobox.js script below the google maps js. here is an example, var marker = new MarkerWithLabel({ position: new google.maps.LatLng(item.Latitude, item.Longitude), map: window.map, zIndex: 10, title: "Hello

Overlay with Google Maps API v3 not reappearing after hide

孤者浪人 提交于 2019-12-13 04:43:30
问题 I read a lot of examples. They all mention to hide the overlay by overlay.setMap(null); That works fine. But showing it again after hiding it before does not work although it will be shown during initialization. All examples tell me to use overlay.setMap(map); But the overlay does not reappear ?! What is wrong? See my code at http://jsbin.com/oworor/3/edit MJ 回答1: The "map" variable is local to the mapInitialize function, change: function mapInitialize() { var myLatlng = new google.maps

Issue with infoWindows with multiple markers and directionsDisplay variables in Google Maps API v3

落爺英雄遲暮 提交于 2019-12-13 04:36:32
问题 I'm trying to display how distance and how minutes are between two markers in Google Maps API v3 and use these information to override the default infoWindow text that appears when the directionsService is fired, I think there is a asyncronous problem with calcRoute() and the infoWindows . This is an example code that reproduces the error. <html> <head> <meta charset='utf-8'> <script src="http://maps.google.com/maps/api/js?sensor=true" type="text/javascript"></script> <script> var

Display mid-ways (waypoints) in google map on latitude and longitude base

妖精的绣舞 提交于 2019-12-13 04:35:32
问题 I want to display midway in a google map. I followed this url : https://developers.google.com/maps/documentation/javascript/examples/directions-waypoints. Where I did make mistake that map didn't show multi-midway. When I used this method status is not ok HTML <input id="start" type="hidden" value="25.687158,32.639656" name="start"> <input id="end" type="hidden" value="24.088931,32.899795" name="end"> <input class="midway" type="hidden" value="27.300000,32.550000" name="midpioints[]"> <input

adding more data to info window

百般思念 提交于 2019-12-13 04:13:13
问题 Merged with adding more data to info window. In my web app, I have currently show just the address of a marker in the marker info window. I want to show the open hours as well. How would I do that? Here is my code so far: function display() { if ((xhr.readyState == 4) &&(xhr.status == 200)) { var xmlDoc=xhr.responseXML; var market = xmlDoc.documentElement.getElementsByTagName("market"); for (var i = 0; i < market.length; i++) { var address= market[i].getElementsByTagName("address"); address =

How to refresh the markers on google maps, without refreshing the map using swift

左心房为你撑大大i 提交于 2019-12-13 03:51:16
问题 Am showing some vehicles on google maps(latitudes & longitudes am getting from API). I am getting latitude & longitudes from storingDataOftripLocDetails() method. And am calling that method for every 2 seconds. After getting lat & long am showing one marker. and here because of timer my google maps is also refreshing. But my requirement is i have to refresh marker only. how should i achieve this? var driverLatitude: Double? var driverLongitude: Double? Here in the following method am calling

Google Maps Refresh Markers

吃可爱长大的小学妹 提交于 2019-12-13 02:56:40
问题 I want to refresh all my markers. I used a setInterval function. But how do i delete my markers? At this time the markers are added to the old markers ... thats not what i intended. So this is my code: <!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; padding: 0 } #map_canvas { height: 100% } </style> <script type="text/javascript" src="http://maps.googleapis.com

MapView.Marker is not stable on user current location moves on zooming and pinching

自闭症网瘾萝莉.ら 提交于 2019-12-13 02:43:06
问题 Hey guys i have created a mapView in react-native now i have to set fix marker on user current location. I have obtained current location using navigator.geolocation also set the marker using MapView.Marker initially marker shows correct location but gets moved on zooming and pinching Here is my code. getInitialState() { return { region: { latitude: LATITUDE, longitude: LONGITUDE, latitudeDelta: LATITUDE_DELTA, longitudeDelta: LONGITUDE_DELTA }, }; }, componentDidMount: function() { navigator

Google Map info window is only showing on one marker in JavaScript

谁都会走 提交于 2019-12-13 02:34:01
问题 I am developing a Website that offers location based service. So I am integrating my website with Google Map API using JavaScript. Then I import the data to Map and show each item as marker on Map. Importing and showing data as markers on map is working fine. But I am having a problem with showing info window for each marker on map. The problem is I got two markers on my map, but when I click on whatever item, info window is always showing on the same item. Please see the screenshot below. As