google-maps-markers

Google Maps API v3 - Markers All Share The Same InfoWindow

亡梦爱人 提交于 2019-11-27 16:16:14
问题 I've been digging around everywhere and I can't seem to figure this out. It's driving me crazy! I'm a newbie to javascript in general, so I can't quite put a finger on the translation that would fix my issue. I noticed that a lot of people have this problem, but they all seem to use more advanced(or just confusing) code than I. Anyway, here goes! I've been having the problem where all of my markers share the same content. function initialize() { var myOptions = { center: new google.maps

Why am i not getting exact Longitude when i click on a marker?

我与影子孤独终老i 提交于 2019-11-27 16:15:01
In my web app i am trying to fetch longitude and latitude of a marker when i click on it. Following is the code which is setting a marker and then try to get the same marker's latitude and longitude when i click on it: var myLatlng = new google.maps.LatLng(55.68322317670628, 13.177157360327598); var marker_obj = new google.maps.Marker({ clickable: true, position: myLatlng, map: dashboard_map, zIndex: i }); marker_obj.setIcon('marker.png'); google.maps.event.addListener(marker_obj, "click", function(event) { var myLatLng = event.latLng; var lat1 = myLatLng.lat(); var lng1 = myLatLng.lng();

Change Google Maps' Selected Marker or change marker's color? [iOS]

。_饼干妹妹 提交于 2019-11-27 15:22:46
问题 I am wondering if there is a way to change the color or image of the selected marker and then change it back when it is not selected anymore. I see that Yelp, which uses Apple Maps, changes the color/image of the selected marker and then back to the original once that one is no longer selected and was wondering if the Google Map iOS SDK had something similar or if someone has come across this problem and found a solution. What I have tried: I have looked through Google's Documentation on

markerclusterer info windows

本小妞迷上赌 提交于 2019-11-27 15:22:13
问题 Let me say I am still fairly new to google maps and javascript. i've been mixing together the google store locator tutorial with some other stuff. So far, I am using marker clusterer plus (link), basically the same as marker clusterer for google maps api v3 but with some added functionality like mouse overs and stuff like that. I'm trying to get an info window to come up when you mouse over a cluster. working demo here. here is my full index code: <html xmlns="http://www.w3.org/1999/xhtml">

What is the difference between “marker.setVisible(false)” and “marker.setMap(null)” in Google Maps v3?

风流意气都作罢 提交于 2019-11-27 14:37:56
问题 I want to clear a marker on Google Maps. What is the difference between marker.setVisible(false) and marker.setMap(null) ? But I don't know, which is right? 回答1: The difference between the two methods does not seem to be clearly documented. However, note the following: When you use setMap(null) , your marker will lose the reference to the Map . If you do not keep a reference to the Map object, you wouldn't be able to reshow the marker. In addition, the setMap() method will not trigger the

google maps iOS SDK: custom icons to be used as markers

末鹿安然 提交于 2019-11-27 14:25:27
The Android API has a very convenient class for this, IconGenerator . Using the IconGenerator in my Android app , I can easily make a marker that: is a simple rectangle with the color of my choosing. resizes to hold text of any length. is NOT an info window - I'd like the marker itself to contain the text as shown in the image below from the android version. // Android - problem solved with IconGenerator IconGenerator iconGenerator = new IconGenerator(context); iconGenerator.setStyle(IconGenerator.STYLE_GREEN); // or any other color Bitmap iconBitmap = iconGenerator.makeIcon(myString); Marker

How can i add a button to google maps marker info window on ios?

老子叫甜甜 提交于 2019-11-27 14:10:27
问题 I have added Google maps sdk for ios to my Iphone app, and i have some custom markers if clicked info window pops up with title, how can i add a button to this info window so if pressed will go to new page? Now i have tryed to use this post to solve this issue Adding Click Event on InfoWindow/Marker in Google Maps SDK for native iOS/objective C it doesnt give me error but it won't work. this is what i want my result to be:http://www.flickr.com/photos/74719051@N05/6728157477/ 回答1: The answer

Custom SVG markers won't display in IE 11

百般思念 提交于 2019-11-27 14:02:01
I'm trying to display some bus routes using Google Data Layer , and then add some custom icon markers. Works great in Chrome and Firefox, but in IE 11 I only get the routes. I get an InvalidStateError somewhere deep in some obfuscated code. the markers use a data uri with some inline SVG that is converted to base 64 strings. I've also tried NOT converting to base 64; that doesn't generate any apparent errors, but the markers still don't display. Simplified javascript is pasted below, and you can see it in action at jsfiddle . var map; map = new google.maps.Map(document.getElementById('map

Google Maps API v3 remove all polylines

柔情痞子 提交于 2019-11-27 13:53:25
问题 Little background. I have a navigation setup for when you click on a certain navigation item, it creates markers on the map. If you click on a different navigation item, it removes the previous markers and sets up new ones. Well now I am working with polylines and trying to create the same concept here with the polylines , however I am having a difficult time. Here is what I have: // Global variable for array of lines var points= []; Setup my points. line1 = new google.maps.LatLng(line1Start,

How to force refresh contents of the markerInfoWindow in Google Maps iOS SDK

℡╲_俬逩灬. 提交于 2019-11-27 13:32:32
I'm returning a UIImageView in - (UIView *)mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker; This UIImageView loads images dynamically through a URL using SDWebImage . As the documentation says about marker info windows: Note: The info window is rendered as an image each time it is displayed on the map. This means that any changes to its properties while it is active will not be immediately visible. The contents of the info window will be refreshed the next time that it is displayed. The point is that after downloading the image the info window doesn't refresh and keep