google-maps-markers

Google Maps API: open url by clicking on marker

泪湿孤枕 提交于 2019-12-17 15:15:53
问题 I want to open a new window by clicking on a marker using Google Maps API 3. Unfortunately there are not many examples for the Google Maps API and I found out this code: google.maps.event.addListener(marker, 'click', function() { window.location.href = marker.url; }); How to use it, when I create markers with a loop? I tried it in many ways with no afford. This is my code – I made it simple and short: <!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user

Google Maps Multiple markers with the exact same location Not working

南笙酒味 提交于 2019-12-17 10:46:50
问题 I want to check to see if any of the existing markers match the latlng of the new marker and if so then merge the info window/tooltip text. This is what I tried to do: <!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <title></title> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/src/markerclusterer.js"></script> <script

Adding multiple markers in Google Maps API v2 Android

喜欢而已 提交于 2019-12-17 10:29:14
问题 I want to add multiple markers in my map, but I don't know the way. At the moment, I'm using this, and it works correctly: Marker m1 = googleMap.addMarker(new MarkerOptions() .position(new LatLng(38.609556, -1.139637)) .anchor(0.5f, 0.5f) .title("Title1") .snippet("Snippet1") .icon(BitmapDescriptorFactory.fromResource(R.drawable.logo1))); Marker m2 = googleMap.addMarker(new MarkerOptions() .position(new LatLng(40.4272414,-3.7020037)) .anchor(0.5f, 0.5f) .title("Title2") .snippet("Snippet2")

How to move marker along polyline using google map

ε祈祈猫儿з 提交于 2019-12-17 09:20:58
问题 I am trying to move the marker according to the polyline and with animation. Similar to the below image: Mapbox is already giving this kind of demo. But I want to achieve the same using Google maps. However right now my marker is not rotating along the path. Here is what I have tried: private void onReady(List<LatLng> polyz) { for (int i = 0; i < polyz.size() - 1; i++) { LatLng src = polyz.get(i); LatLng dest = polyz.get(i + 1); Polyline line = map.addPolyline(new PolylineOptions() .add(new

How to get the formatted address from a dragged marker in Google Version Maps

走远了吗. 提交于 2019-12-17 06:09:13
问题 I have made a Google map that lets you input an address into a text field. It then navigates you to the address that you entered into the text field and leaves a draggable marker that when dragged shows you the Lat and Long and The Geolocated Address. I instead of displaying the above address, would like when you drag the marker to display in the bottom corner the Address of the Marker and the not the inputted address from the text field. I have tried a number of methods to no avail. lonlat[0

Google Maps API - Getting closest points to zipcode

我的梦境 提交于 2019-12-17 02:38:16
问题 I'm in the process of adding a map to a website using Google Maps API v3 and javascript. I have a list of addresses and have successfully plotted them on the map. When the user types in a zip code, the map re-centers on their location showing the markers closest to that point. Now, I need to create a list view of the closest 3 or 5 locations to their zip code with links for driving direction. I'm stuck...and open for suggestions. 回答1: The usual solution is to use the google.maps.geometry

Creating simple Google maps with multiple markers to website

房东的猫 提交于 2019-12-14 03:34:18
问题 I created google map with multiple markers to my website with "Google My Maps" tool and my code looks like this: <iframe src="https://www.google.com/maps/d/u/0/embed?mid=1PdcME79x-maD5xuiVEi4C777aL4" width="640" height="480"></iframe> It was really quick and simple without any code writting but what I don't like is the header bar which is showing the name and share button. Can I somehow hide this bar? Thank you. 回答1: You can get the link to the KML from that "MyMap": http://www.google.com

Circle fade out over time on Google Map [duplicate]

◇◆丶佛笑我妖孽 提交于 2019-12-14 03:24:26
问题 This question already has an answer here : How do I fade out a circle in a Google Map, x seconds after I've added it to the map? (1 answer) Closed 4 years ago . I am attempting to fade circles out with a setInterval on fillOpacity. However a console log shows the opacity changing but the appearance of the circle does not seem to change. Is there a different set function required to do this? http://jsfiddle.net/faaxeskg/5/ setInterval(function() { marker.fillOpacity -= .01; console.log(marker

how do I add same event listener to many markers and then differentiate between the markers in the listeners in google maps api v3?

孤街浪徒 提交于 2019-12-14 02:40:30
问题 I have the same event listener for many markers in my javascript. How do I differentiate between different markers in this listener? I want to display another marker elsewhere on clicking of a particular marker. Every marker has another marker which I display on clicking on it. the event listener code google.maps.event.addListener(marker, 'click', function() { //code goes here }); more detail: I have 2 arrays markers1 and markers2 each having 10 markers. I display the 10 from markers1 on my

Marker label overlapping when two markers are close to each other. How to give background color to google maps marker?

风流意气都作罢 提交于 2019-12-14 01:32:43
问题 I am using google maps version 3 api and google maps marker. When the markers are close to each other the labels overlap and it looks bad. I was trying to give background color to the marker label but google maps marker label does not seem to have background color property. I tried using MarkerWithLabel api but rendering was slower when I had 1000s of markers compared to google maps deafult Marker Label. I have included the js fiddle. Can anyone please help me with this ? https://jsfiddle.net