infowindow

Google maps: infowindow is not closing

早过忘川 提交于 2019-11-28 02:28:09
My infowindows are not closing automatically when i click on the other marker.. here the code : http://pastebin.com/PvCt2z7W here is the code for markers with infowindows for (var n = 0 ; n <listFavourite.length ; n++) //var favouriteObject =listFavourite[n]; addMarker(listFavourite[n]); } function addMarker(data) { var marker = new google.maps.Marker({ position: new google.maps.LatLng(data.lattitude, data.longitude), map: map, title: data.address }); var contentString = '<div id="content">'+ '<div id="siteNotice">'+ '</div>'+ '<h2 id="firstHeading" class="firstHeading">'+data.name+'</h2>'+ '

Multiple markers and infowindows on Google Maps (using MySQL)

给你一囗甜甜゛ 提交于 2019-11-28 02:23:46
There are another four if statements which do the same thing for other categories. <?php if (isset($_POST['one'])) { $query = "SELECT * FROM beerstable WHERE category LIKE \"%Lager%\""; $result = mysql_query($query); if (!$result) { die('Invalid query: ' . mysql_error()); } while ($row = mysql_fetch_assoc($result)) { $lat = $row['lat']; $lng = $row['lng']; $markername = $row['name']; $link = $row['link']; $photo = $row['photo']; ?> var infowindow = new google.maps.InfoWindow({ content: '<h1><?php echo $markername ?></h1><br><img src="<?php echo $photo ?>" height="30" width="50"><br><a href="<

google map info window multiple addresses via xml

久未见 提交于 2019-11-28 02:13:44
I'm using the Google map code below to retrieve and plot markers for multiple addresses from an XML file dynamically created with PHP. The code is doing everything I need except for displaying the correct information in the Google map info window for the corresponding marker. I get the information of the last XML item/listing for all the markers. I've been searching and trying different variations to get it to work, but no luck. sample XML data <?xml version="1.0" encoding="UTF-8"?> <listings> <listing> <address>123 Street</address> <city>MANOTICK</city> </listing> <listing> <address>456

Creating custom info window in swift with the Google maps iOS sdk?

白昼怎懂夜的黑 提交于 2019-11-28 00:14:25
I have created a xib and a view controller, and want to display it a customised info window for a marker in swift. After searching on the Internet I have found an old tutorial in OBJ-C however this will not help me. Thank you. You can implement the markerInfoWindow method from GMSMapViewDelegate Sample implementation to show an custom info window in Swift: func mapView(mapView: GMSMapView!, markerInfoWindow marker: GMSMarker!) -> UIView! { var infoWindow = NSBundle.mainBundle().loadNibNamed("CustomInfoWindow", owner: self, options: nil).first! as CustomInfoWindow infoWindow.label.text = "\

Multiple line or break line in .snippet (google maps apiv2)

ぃ、小莉子 提交于 2019-11-27 20:48:56
I'm developing in google maps APIv2. The issue that I'm facing now is I only able to add in one line of word in info windows/snippet. But the output that I want is able to display in break line form as example show below. So is there any possible methods to solve it? Example: Coordinate: 03.05085, 101.70506 Speed Limit: 80 km/h public class MainActivity extends FragmentActivity { static final LatLng SgBesi = new LatLng(03.05085, 101.76022); static final LatLng JB = new LatLng(1.48322, 103.69065); private GoogleMap map; @Override protected void onCreate(Bundle savedInstanceState) { super

Google Maps API V3 infoWindow - All infoWindows displaying same content

梦想与她 提交于 2019-11-27 16:21:39
In my page, latitude, longitude and info window content are present in an array of objects named obj. So if I need the latitude of property of the 1st object, I can call obj[0].latitude. The infoWindow content for each object is stored in obj[i].text. I'm using the below loop to loop through the lat & long values and display the markers and infoWindows. for (x=1; x<=obj.length; x++) { var latlng1 = new google.maps.LatLng(obj[x].latitude, obj[x].longitude); var marker2 = new google.maps.Marker({ position : latlng1, map : map, icon : prevIcon }); infowindow = new google.maps.InfoWindow(); info =

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

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">

Add a google chart to a infowindow using google maps api

荒凉一梦 提交于 2019-11-27 13:26:28
问题 I've seen many other people with the same question but couldn't find a answer. I have a simple map I built using the Google Maps Javascript api v3. The map has a few markers which are linked to an infowindow to display specific information for each marker. I want to add a google chart to the infowindow but just couldn't figure out how to do it. I went through every single post I could find (here and in other forums) and I've noticed other people trying to do something similar but seems that

Adding event to element inside Google Maps API InfoWindow

徘徊边缘 提交于 2019-11-27 12:25:10
I want to put a form with input field and submit button inside a Google Maps API (v3) InfoWindow. When submitted I would like to call a function that initiates the directions service using the address entered into the input field. Here's my code (I'm currently only testing whether the directions event is being fired. I've written the full getDirections() event and can confirm it works and returns directions when fired properly): I tried adding an event listener using MooTools, like this: var infoWindowContent = "<b>Get Directions From...</b><br />" + "<form id='map-form'>" + "Address/Postcode: