google-maps-markers

How to add polylines with an array of position?

折月煮酒 提交于 2019-12-13 09:22:32
问题 I have a simple array containing name of cities. I'm trying to loop through this array and add markers linked by Polylines on the Google Map. Here is my code: function addMarkerCity(cities) { $.each(cities, function(index, value) { geocoder.geocode({'address': value}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { var cityPosition = results[0].geometry.location; flightRoute.push(cityPosition); var currentMarker = map.addMarker({ position: cityPosition }); }); }); }

How do i access all my google maps markers

江枫思渺然 提交于 2019-12-13 08:56:52
问题 I am not seeing it i'll think if one of you looks at it can immediately tell me what i have to do. Now i resize my marker but it only takes the last marker of the array. here the code I'll loop trough the array of object markers: var locations = [ [{id: 1, lat: 51.523229192354066, lng: 5.139241042480535, content: 'Title A'}], [{id: 2, lat: 51.52309568310267, lng: 5.139251771316594, content: 'Title B'}], [{id: 3, lat: 51.5229888754197, lng: 5.139434161529607, content: 'Title C'}], [{id: 4, lat

How to load markers from XML file with directions API in Google Maps

流过昼夜 提交于 2019-12-13 08:27:40
问题 I'm trying to load markers from XML file on a map used for outputing directions. Basically, it's the combination of two demos found on Google's documentation pages. Directions: https://google-developers.appspot.com/maps/documentation/javascript/examples/directions-panel XML: http://gmaps-samples-v3.googlecode.com/svn/trunk/xmlparsing/downloadurl_info.html I have first created the directions map and then tried to add XML file that contains markers. I'm probably making a simple mistake, but

Adding Custom Markers (HTMLMarkers) to Clustering

故事扮演 提交于 2019-12-13 08:24:12
问题 I have a working codepen demo of Google Maps Clustering. I'm trying to add in custom html element markers so I can have dynamic text like so: However, when I add in my custom html element marker script (which works by itself) to my marker cluster script - it breaks. Here's my script. If you comment in the broken section (lines 69 - 89) - it stops working. // WORKING function initMap() { var map = new google.maps.Map(document.getElementById("map"), { zoom: 12, center: { lat: 37.773972, lng:

Remove HTML markers from Google Map

假如想象 提交于 2019-12-13 08:09:01
问题 I'm using goole maps overlay to add HTML as markers but i don't know how to use HTMLMarker.prototype.onRemove method to remove all markers added. Following this code http://jsfiddle.net/BCr2B/ var overlay; function initialize() { var myLatLng = new google.maps.LatLng(62.323907, -150.109291); var mapOptions = { zoom: 11, center: myLatLng, mapTypeId: google.maps.MapTypeId.SATELLITE }; var gmap = new google.maps.Map(document.getElementById('map_canvas'), mapOptions); function HTMLMarker(lat,lng)

How to retrieve google Markers

99封情书 提交于 2019-12-13 08:04:11
问题 How to retrieve all existing markers on the public map created by me in javascript. In html I am adding following tag. <iframe src="https://www.google.com/maps/d/u/0/embed?mid=zJ463bGh1PYM.kWHWVlcByQeU" width="640" height="480"></iframe> Now I want to extract all the markers present on this map in Javascript. Please help me in this. 回答1: click on the choose "Download KML" check the "Keep data up to date with network link KML (only usable online)." rename the resulting .kmz file as .zip open

Only Plotting Markers Within a Drawn Circle or Perimeter Google Maps v2 Android

会有一股神秘感。 提交于 2019-12-13 07:46:01
问题 Basically the title says it all. Rather than plotting every single entry in my database on a map as I do at the moment, I want to query the database and only plot the entries whose co-ordinates fall within the circle drawn around the users current location, however I can't quite figure out how to do it. At the moment, I have written code that plots the users current location on the map along with the locations of all the entries stored on my database and also the circle around the current

Getting Number of Markers of visible region of google maps android

喜你入骨 提交于 2019-12-13 07:11:53
问题 How can we calculate the number of those markers shown on the visible region only on google maps android? 回答1: var markers; //your markers var map; //your map var countInBoundingBox = 0; //the counter for the markers in bounding box for (var i = markers.length, bounds = map.getBounds(); i--;) { if (bounds.contains(markers[i].getPosition())) { countInBoundingBox++; } } Next time try to provide a Minimal, Complete, and Verifiable example. :-) 来源: https://stackoverflow.com/questions/38896671

Zoom function Google maps

你离开我真会死。 提交于 2019-12-13 06:17:21
问题 I've created a button inside my info window that needs to pan to the marker and then zoom in but I can't get it to work. Below is my Zoom function function Zoom(){ google.maps.event.addListener(marker, 'click', function() { map.panTo(marker.position); map.setZoom(18); }); and this the function that creates the marker and fills the info window with the html below. function createMarker(latlng, name, woonplaats, prijs, perceelop, woonop, address) { var html ="<a href="+address+">"+"<b>"+name+"<

How to add markers on top of a polygon using Google Maps Javascript API?

主宰稳场 提交于 2019-12-13 05:24:48
问题 I'm using the Google Maps Javascript API, and I've defined a polygon and attached it to a map: const region = new google.maps.Polygon({ map: map, paths: [ { lat: 40.5577151228437, lng: -74.15980859374997 }, { lat: 40.599436503265856, lng: -74.27516503906247 }, { lat: 40.67030312529891, lng: -74.25319238281247 }, { lat: 40.72548139969253, lng: -74.26079167357881 }, ], }); I have a click handler that adds a marker on it when the user clicks: google.maps.event.addListener(map, 'click', function