Search Results

Search found 93 results on 4 pages for 'infowindow'.

Page 2/4 | < Previous Page | 1 2 3 4  | Next Page >

  • How to center map on marker and open marker's InfoWindow in one method

    - by sMariusz
    I'm using Google Map APIv2. On my webpage I've a sidebar containing a list of markers with onclick event executing showDetails method, that looks like: GMarker.prototype.showDetails=function() { map.panTo(this.getLatLng()); this.openInfoWindowHtml(this.details); }; The problem is that i cannot both panTo and openInfoWindowHtml in one method, it pans but won't open tooltip and when i change method to: GMarker.prototype.showDetails=function() { this.openInfoWindowHtml(this.details); map.panTo(this.getLatLng()); }; it opens tooltip but won't center map to the marker's anchor coordinates. Even using wait function doesn't solve my problem. What am I doing wrong?

    Read the article

  • Need Google Map InfoWindow Hyperlink to Open Content in Overlay (Fusion Table Usage)

    - by McKev
    I have the following code established to render the map in my site. When the map is clicked, the info window pops up with a bunch of content including a hyperlink to open up a website with a form in it. I would like to utilize a function like fancybox to open up this link "form" in an overlay. I have read that fancybox doesn't support calling the function from within an iframe, and was wondering if there was a way to pass the link data to the DOM and trigger the fancybox (or another overlay option) in another way? Maybe a callback trick - any tips would be much appreciated! <style> #map-canvas { width:850px; height:600px; } </style> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> <script src="http://gmaps-utility-gis.googlecode.com/svn/trunk/fusiontips/src/fusiontips.js" type="text/javascript"></script> <script type="text/javascript"> var map; var tableid = "1nDFsxuYxr54viD_fuH7fGm1QRZRdcxFKbSwwRjk"; var layer; var initialLocation; var browserSupportFlag = new Boolean(); var uscenter = new google.maps.LatLng(37.6970, -91.8096); function initialize() { map = new google.maps.Map(document.getElementById('map-canvas'), { zoom: 4, mapTypeId: google.maps.MapTypeId.ROADMAP }); layer = new google.maps.FusionTablesLayer({ query: { select: "'Geometry'", from: tableid }, map: map }); //http://gmaps-utility-gis.googlecode.com/svn/trunk/fusiontips/docs/reference.html layer.enableMapTips({ select: "'Contact Name','Contact Title','Contact Location','Contact Phone'", from: tableid, geometryColumn: 'Geometry', suppressMapTips: false, delay: 500, tolerance: 8 }); ; // Try W3C Geolocation (Preferred) if(navigator.geolocation) { browserSupportFlag = true; navigator.geolocation.getCurrentPosition(function(position) { initialLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude); map.setCenter(initialLocation); //Custom Marker var pinColor = "A83C0A"; var pinImage = new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|" + pinColor, new google.maps.Size(21, 34), new google.maps.Point(0,0), new google.maps.Point(10, 34)); var pinShadow = new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_shadow", new google.maps.Size(40, 37), new google.maps.Point(0, 0), new google.maps.Point(12, 35)); new google.maps.Marker({ position: initialLocation, map: map, icon: pinImage, shadow: pinShadow }); }, function() { handleNoGeolocation(browserSupportFlag); }); } // Browser doesn't support Geolocation else { browserSupportFlag = false; handleNoGeolocation(browserSupportFlag); } function handleNoGeolocation(errorFlag) { if (errorFlag == true) { //Geolocation service failed initialLocation = uscenter; } else { //Browser doesn't support geolocation initialLocation = uscenter; } map.setCenter(initialLocation); } } google.maps.event.addDomListener(window, 'load', initialize); </script>

    Read the article

  • Google Maps API v3 - Directions/Paths breaking KML Overlay Infowindows

    - by Douglas
    I'm in the end stages before content filling and then production on the Google Maps project I've been working on. A number of bugs and such have been thwarted, but this latest one has me relatively stumped. The demo map can be viewed here: http://dougglover.com/samples/finalProduct/ Everything works fine until you create a path using the Directions section(not to be confused with Get Directions). To reproduce the problem, play around with the map, click on a building or two, just to see the functionality. After ensuring that clicking on a building works(brings up an infowindow), choose two buildings to get directions to in the Directions area. It works great with the routing algorithm I've implemented, and the paths show up nicely, and intelligently. The problem being that you can't click buildings anymore to see their info. I'm assuming it has something to do with the z-index error popping up in the console, but I'm not sure how to handle that if it is the problem. Any guidance is greatly appreciated. :)

    Read the article

  • using multi-markers with multi info-windows

    - by mohsen
    I have an array of info-windows corresponding to an array of markers. Now, I have a problem, I use the below code to generate an info-window, when clicking on the marker all the markers disappear unless one, also when I click on that marker there is no info-window come out. What is the wrong with my code ? or what shall I do ? Any answer will be very appreciated, Thanks in advance. This code is inside a for loop: infoWindoArray[i][j] = new google.maps.InfoWindow({ content:"Lat: "+this.position.lat() + "\nLng: " + this.position.lng() + "\n"+ this.customInfo, }); google.maps.event.addListener(AllMarkers[i][j], 'click', (function(x) { return function() {infoWindoArray[i][j].open(map,AllMarkers[i][j]);} })(x));

    Read the article

  • How to connect InfoWindow II to 9406-250 console?

    - by Yvan JANSSENS
    How do I connect an InfoWindow II to the 9406-250 console? I recieved an old InfoWindow II (don't know the exact model number yet) from somebody, and want to connect to the console so I can do a manual IPL. I am totaly new to this, and I am still learning how to use everything. Here's the back of the 9406-250 with available connections: https://dl.dropbox.com/u/15854305/connectors.JPG What cabling do I need, and where can I order it?

    Read the article

  • Google maps API - info window height and panning

    - by Tim Fountain
    I'm using the Google maps API (v2) to display a country overlay over a world map. The data comes from a KML file, which contains coords for the polygons along with a HTML description for each country. This description is displayed in the 'info window' speech bubble when that country is clicked on. I had some trouble initially as the info windows were not expanding to the size of the HTML content they contained, so the longer ones would spill over the edges (this seems to be a common problem). I was able to work around this by resetting the info window to a specific height as follows: GEvent.addListener(map, "infowindowopen", function(iw) { iw = map.getInfoWindow(); iw.reset(iw.getPoint(), iw.getTabs(), new GSize(300, 295), null, null); }); Not ideal, but it works. However now, when the info windows are opened the top part of them is sometimes obscured by the edges of the map, as the map does not pan to a position where all of the content can be viewed. So my questions: Is there any way to get the info windows to automatically use a height appropriate to their content, to avoid having to fix to a set pixel height? If fixing the height is the only option, is there any way to get the map to pan to a more appropriate position when the info windows open? I know that the map class has a panTo() method, but I can't see a way to calculate what the correct coords would be. Here's my full init code: google.load("maps", "2.x"); // Call this function when the page has been loaded function initialize() { var map = new google.maps.Map2(document.getElementById("map"), {backgroundColor:'#99b3cc'}); map.addControl(new GSmallZoomControl()); map.setCenter(new google.maps.LatLng(29.01377076013671, -2.7866649627685547), 2); gae_countries = new GGeoXml("http://example.com/countries.kmz"); map.addOverlay(gae_countries); GEvent.addListener(map, "infowindowopen", function(iw) { iw = map.getInfoWindow(); iw.reset(iw.getPoint(), iw.getTabs(), new GSize(300, 295), null, null); }); } google.setOnLoadCallback(initialize);

    Read the article

  • Display the info window of a Google map marker

    - by Keyslinger
    I have succeeded in loading a Google map using the gMap jQuery plugin and making it display several markers passed to it in a JSON object using the pattern demonstrated here under "Map with marker and info window". So far, so good. Now I want to have a link on the same page which, when clicked, displays the info window for a marker on the map. How is this done?

    Read the article

  • Pass variable to Info Window in FusionTableLayer

    - by user1030205
    I am building a web application that includes a Google Map layered with data from a Google Fusion Table. I have defined the info window for the markers in the Fusion Table and all is rendering as expected, but I have one issue. I need to pass a session variable from my web application to be included in the links that are defined in the info window, but can't seem to find a way to do this. Below is the javascript I am currently using to render the map: var myOptions = { zoom: 10, mapTypeId: google.maps.MapTypeId.ROADMAP, center: new google.maps.LatLng( 40.4230,-98.7372) } map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); // Weather weatherLayer = new google.maps.weather.WeatherLayer({ temperatureUnits: google.maps.weather.TemperatureUnit.FAHRENHEIT }); weatherLayer.setMap(map); //Hobby Stores var storeLayer = new google.maps.FusionTablesLayer({ query: { select: "col2", from: "3991553" }, map: map, supressInfoWindows: true }); //Club Sites var siteLayer = new google.maps.FusionTablesLayer({ query: { select: "col13", from: "3855088" }, styles: [{ markerOptions: { iconName: "airports" }}], map: map, supressInfoWindows: true }); I'd like to be able to pass some type of parameter in the call to google.maps.FusionTableLayer that passes a value to be include in the info window, but can't find a way to do this. To view the actual page, visit www.dualrates.com. Enter your zipcode and select one of the airport markers to see the info window. You may have to zoom the map out to see an airfield.

    Read the article

  • Google Maps: How does Trulia create their custom InfoWIndows?

    - by NickT
    I really like how Trulia.com has created their custom Google Map InfoWindows. What I like in particular about Trulia's implementation of the InfoWindow is: Extends beyond the map border: Google Maps InfoWindows are contained within the map border whereas Trulia's seems to be able to float on-top of the map Always displays InfoWindow near map Center: Google Maps InfoWindows always display the InfoWindow above the marker whereas Trulia InfoWindows always display the InfoWindow as close the center of the map as possible. For example, if the map marker icon is on the top of the map near the border, the Trulia InfoWindow is displayed below the map marker icon InfoWindow is displayed on mouse hover (not 'click'): With the default Google Maps InfoWindow, you have to 'click' the map marker icon to display the InfoWindow whereas Trulia InfoWindows are display simply by hovering over the map marker icon. I found the PdMarker, which is a 3rd party extension for Google Map InfoWindows that accomplishes most of the above bullets but not all. 1) It does not extend beyond the map border, 2) it does not work with Google Maps API version 3 (only version 2). Anyone know how Trulia is accomplishing their InfoWindow-like implementation on Google Maps API v3?

    Read the article

  • Google Maps API v3 - infoWindows all have same content

    - by paulriedel
    Hello, I've been having problems with the infoWindows and Google Maps API v3. Initially, I've ran into the problem that everyone else has of closing infoWindows when opening a new one. I thought to have solved the problem by defining "infowindow" beforehand. Now they close when I click on a new marker, but the content is the same. How should I re-structure my code to make sure the content is the right one each time - and only one infoWindow is open at a given time? Thank you! Paul var allLatLngs = new Array(); var last = 0; var infowindow; function displayResults(start, count){ if(start === undefined){ start = last; } if(count === undefined){ count = 20; } jQuery.each(jsresults, function(index, value) { if(index >= start && index < start+count){ var obj = jQuery.parseJSON(value); $("#textresults").append(index + ": <strong>" + obj.name + "</strong> " + Math.round(obj.distanz*100)/100 + " km entfernt" + "<br/>"); var myLatlng = new google.maps.LatLng(obj.geo_lat, obj.geo_lon); allLatLngs.push(myLatlng); var contentString = '<strong>'+obj.name+'</strong>'; infowindow = new google.maps.InfoWindow({ content: contentString }); var marker = new google.maps.Marker({ position: myLatlng, //title:"Hello World!" }); marker.setMap(map); google.maps.event.addListener(marker, 'click', function() { if (infowindow) { infowindow.close(map,marker); } infowindow.open(map,marker); }); } }); last = start+count;

    Read the article

  • How to achieve Bing maps like InfoWindow in Google Maps?

    - by BillB
    I'm using Google Maps v3. I really like the InfoWindows found in Bing, as opposed to Google. Screenshots & functionality found here comparing the two: http://www.axismaps.com/blog/2009/07/data-probing-and-info-window-design-on-web-based-maps/ Question: How can I replicate Bing like InfoWindows while using Google Maps v3? UPDATE: To be more specific, what I like about Bing's InfoWindows include: - The pointer dynamically changes sides from left/right/bottom/top, as opposed to Google limited to only have the InfoWindow pointer on the bottom - Bing's InfoWindows use less space - You can configure Bing's InfoWindows to pop up outside of the map bounders so that you don't have to autopan the map to display the marker's InfoWindow

    Read the article

  • How to obtain Bing maps like InfoWindow in Google Maps?

    - by BillB
    I'm using Google Maps v3. I really like the InfoWindows found in Bing, as opposed to Google. Screenshots & functionality found here comparing the two: http://www.axismaps.com/blog/2009/07/data-probing-and-info-window-design-on-web-based-maps/ Question: How can I replicate Bing like InfoWindows while using Google Maps v3? UPDATE: To be more specific, what I like about Bing's InfoWindows include: - The pointer dynamically changes sides from left/right/bottom/top, as opposed to Google limited to only have the InfoWindow pointer on the bottom - Bing's InfoWindows use less space - You can configure Bing's InfoWindows to pop up outside of the map bounders so that you don't have to autopan the map to display the marker's InfoWindow

    Read the article

  • close other infowindows nicely.

    - by raklos
    Im currently doing this to create markers for my google map. function createMarker(posn, title, html) { var marker = new google.maps.Marker({ position: posn, title: title, draggable: false }); marker['infowindow'] = new google.maps.InfoWindow({ content: html }); infoWindows.push(marker['infowindow']); google.maps.event.addListener(marker, "click", function () { for (i = 0; i < infoWindows.length; i++) { infoWindows[i].close(); } this['infowindow'].open(map, this); }); return marker; } im not happy with the for loop, for closing the markers, i know something similar to this can be done by using one refernce: if (infowindow) infowindow.close(); the reason I am using code like above is because i am doing something like markers[myPoint]['infowindow'].open(map, markers[myPoint]); else where, (myPoint is a number). how can i avoid this for loop to close open infowindows and do it the nice way?

    Read the article

  • Using an array as parameter to a class.

    - by Gabriel A. Zorrilla
    I have created an array Man: public main blah blah{ man = man[10]; } Man has fields such as Man.name; Man.age; ... In Man class, there is a OnClick method that opens a new window showing its name and age. public Man(){ Onclick(){ InfoWindow showinfo = new InfoWindow(this.getid()) // If this is Man[2] the id would be 2. } And in InfoWindow class: public class InfoWindow extends JFrame{ public InfoWindow(Man selectedMan){ setSize(300, 200); JLabel info = new JLabel(selectedMan.getname()); add(info); info.setVisible(true); } } Basically, that's wanna acomplish (show in pseudocode), pass a Man[i] into a class that when a window is created, shows the info related to that man. This is how i'm actualy trying to implement it but it's not working, i'm pretty sure there is a misconception from me in some part. Any help?

    Read the article

  • php script google maps points from mysql (google example)

    - by user1637477
    I have recently added style information to my maps script, and it stopped working. Have I done something wrong? Guess you can tell I'm very new to this. Any help appreciated. <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="content-type" content="text/html; charset=utf-8"><title>Google Maps AJAX + mySQL/PHP Example</title> <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ ( *******************I INSERTED HERE ) var styles = [ { stylers: [ { hue: "#00ffe6" }, { saturation: -20 } ] },{ featureType: "road", elementType: "geometry", stylers: [ { lightness: 100 }, { visibility: "simplified" } ] },{ featureType: "road", elementType: "labels", stylers: [ { visibility: "off" } ] } ];**( ******************************** THROUGH TO HERE ) map.setOptions({styles: styles}); var customIcons = { restaurant: { icon: 'http://labs.google.com/ridefinder/images/mm_20_blue.png', shadow: 'http://labs.google.com/ridefinder/images/mm_20_shadow.png' }, bar: { icon: 'http://labs.google.com/ridefinder/images/mm_20_red.png', shadow: 'http://labs.google.com/ridefinder/images/mm_20_shadow.png' } }; function load() { var map = new google.maps.Map(document.getElementById("map"), { center: new google.maps.LatLng(-37.7735, 175.1418), zoom: 10, mapTypeId: 'roadmap' }); var infoWindow = new google.maps.InfoWindow; // Change this depending on the name of your PHP fileBHBHBHBHBHBHBHBBBBBBBBBBBBBBBBBBBBBBBBBBB downloadUrl("mywebsite-no i did this just a minute ago", function(data) { var xml = data.responseXML; var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { var name = markers[i].getAttribute("name"); var address = markers[i].getAttribute("address"); var type = markers[i].getAttribute("type"); var point = new google.maps.LatLng( parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng"))); var html = "<b>" + name + "</b> <br/>" + address; var icon = customIcons[type] || {}; var marker = new google.maps.Marker({ map: map, position: point, icon: icon.icon, shadow: icon.shadow }); bindInfoWindow(marker, map, infoWindow, html); } }); } function bindInfoWindow(marker, map, infoWindow, html) { google.maps.event.addListener(marker, 'click', function() { infoWindow.setContent(html); infoWindow.open(map, marker); }); } function downloadUrl(url, callback) { var request = window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest; request.onreadystatechange = function() { if (request.readyState == 4) { request.onreadystatechange = doNothing; callback(request, request.status); } }; request.open('GET', url, true); request.send(null); } function doNothing() {} //]]> </script><!--Adobe Edge Runtime--> <script type="text/javascript" charset="utf-8" src="map500x1000_edgePreload.js"></script> <style> .edgeLoad-EDGE-12956064 { visibility:hidden; } </style> <!--Adobe Edge Runtime End--> </head> <body onload="load()"> <div id="map" style="width: 1000px; height: 1000px;" class="edgeLoad-EDGE-12956064"></div> </body></html>

    Read the article

  • Google Maps API - Marker not showing

    - by popnbrown
    I'm trying to add markers for every single row from a table, that sits on the page. The page is http://www.sravanks.com/first/2013ftcmap.php This is the JS code that's loading the markers: $(document).ready(function() { var mapOptions = { center: new google.maps.LatLng(39.740, -89.503), zoom: 7 }; var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); var infowindow = new google.maps.InfoWindow(); /* City Markers */ var cityCircle = new Array(); var i = 0; $.each($('.events tr'), function(index, value) { var name = $(this).find('td:first()').html(); var address = $(this).find('.address').html(); var linkUrl = "http://www.sravanks.com/first/geocode.php?address=" + address; $.ajax({ url: linkUrl }).done(function(data){ var json = $.parseJSON(data.substring(0, data.length-1)); lat = json.results[0].geometry.location.lat; lng = json.results[0].geometry.location.lng; var latlng = new google.maps.LatLng(lat, lng); var marker = new google.maps.Marker({ position: latlng, map: map, icon: 'map-pointer-medium.gif' }); google.maps.event.addListener(marker, 'click', function() { infowindow.setContent(name); infowindow.open(map, marker); cityCircle[i] = new google.maps.Circle({strokeColor: '#00FF00', strokeOpacity: 0.8, strokeWeight: 2, fillColor: '#00FF00', fillOpacity: 0.35, map: map, center: latlng, radius: 144841}); i++; }); }); }); /*Team Markers*/ var markers = {}; var teamName, teamNumber, lat, lng, content; $.each($('.list tr'), function(index, value) { teamName = $(this).find('td.name').html(); teamNumber = $(this).find('td.number').html(); markers[teamNumber] = {}; lat = parseFloat($(this).find('td.lat').html()); lng = parseFloat($(this).find('td.lng').html()); content = "Name: " + teamName + "<br />Number: " + teamNumber; markers[teamNumber]['latlng'] = new google.maps.LatLng(lat, lng); markers[teamNumber]['marker'] = new google.maps.Marker({ position: markers[teamNumber]['latlng'], map: map }); google.maps.event.addListener(markers[teamNumber]['marker'], 'click', function() { infowindow.setContent(content); infowindow.open(map, markers[teamNumber]['marker']); }); }); google.maps.event.addListener(infowindow, 'closeclick', function() { for(var i=0;i<cityCircle.length;i++){ cityCircle[i].setMap(null); } }); }); I've got no errors, but the Team Markers do not show up. The strange thing is that the City Markers do show up. Some more info, the City Markers ajax call is just to a proxy that calls the google geocoding api. Again the link's at http://www.sravanks.com/first/2013ftcmap.php

    Read the article

  • Setting marker title in Google Maps API 3 using jQuery

    - by bateman_ap
    Hi, I am having a couple of problems with Google Maps and jQuery. Wondered if anyone can help with the smaller of the two problems and hopefully it will help me to fixing the bigger one. I am using the below code to populate a google map, basically it uses generated HTML to populate the maps in the form: <div class="item mapSearch" id="map52.48228_-1.9026:800"> <div class="box-prise"><p>(0.62km away)</p><div class="btn-book-now"> <a href="/venue/800.htm">BOOK NOW</a> </div> </div><img src="http://media.toptable.com/images/thumb/13152.jpg" alt="Metro Bar and Grill" width="60" height="60" /> <div class="info"> <h2><a href="/venue/800.htm">Metro Bar and Grill</a></h2> <p class="address">73 Cornwall Street, Birmingham, B3 2DF</p><strong class="proposal">2 courses £14.50</strong> <dl> <dt>Diner Rating: </dt> <dd>7.8</dd> </dl></div></div> <div class="item mapSearch" id="map52.4754_-1.8999:3195"> <div class="box-prise"><p>(0.97km away)</p><div class="btn-book-now"> <a href="/venue/3195.htm">BOOK NOW</a> </div> </div><img src="http://media.toptable.com/images/thumb/34998.jpg" alt="Filini Restaurant - Birmingham" width="60" height="60" /> <div class="info"> <h2><a href="/venue/3195.htm">Filini Restaurant - Birmingham</a></h2> <p class="address">Radisson Blu Hotel, 12 Holloway Circus, Queensway, Birmingham, B1 1BT</p><strong class="proposal">2 for 1: main courses </strong> <dl> <dt>Diner Rating: </dt> <dd>7.8</dd> </dl></div></div> <div class="item mapSearch" id="map52.47775_-1.90619:10657"> <div class="box-prise"><p>(1.05km away)</p><div class="btn-book-now"> <a href="/venue/10657.htm">BOOK NOW</a> </div> </div><img src="http://media.toptable.com/images/thumb/34963.jpg" alt="B1 " width="60" height="60" /> <div class="info"> <h2><a href="/venue/10657.htm">B1 </a></h2> <p class="address">Central Square , Birmingham, B1 1HH</p><strong class="proposal">25% off food</strong> <dl> <dt>Diner Rating: </dt> <dd>7.9</dd> </dl></div></div> The JavaScript loops though all the divs with class mapSearch and uses this to plot markers using the div ID to get the lat/lon and ID of the venue: var locations = $(".mapSearch"); for (var i=0;i<locations.length;i++) { var id = locations[i].id; if (id) { var jsLonLat = id.substring(3).split(":")[0]; var jsId = id.substring(3).split(":")[1]; var jsLat = jsLonLat.split("_")[0]; var jsLon = jsLonLat.split("_")[1]; var jsName = $("h2").text(); var jsAddress = $("p.address").text(); var latlng = new google.maps.LatLng(jsLat,jsLon); var marker = new google.maps.Marker({ position: latlng, map:map, icon: greenRestaurantImage, title: jsName }); google.maps.event.addListener(marker, 'click', function() { //Check to see if info window already exists if (!infowindow) { //if doesn't exist then create a empty InfoWindow object infowindow = new google.maps.InfoWindow(); } //Set the content of InfoWindow infowindow.setContent(jsAddress); //Tie the InfoWindow to the market infowindow.open(map,marker); }); bounds.extend(latlng); map.fitBounds(bounds); } } The markers all plot OK on the map, however I am having probs with the infoWindow bit. I want to display info about each venue when clicked, however using my code above it just puts all info in one box when clicked, not individually. Hoping it is a simple fix! Hoping once I fix this I can work out a way to get the info window displaying if I hover over the div in the html.

    Read the article

  • Google Maps : How to open an InfoWindow by hovering a link?

    - by JB
    Hi there, i have a very simple question about Google Maps API. In this case, i have on my page a map on the left, with about 40 points, and the list of these 40 points on the right. So you know, when you click on a point of the map, the "info window" is displayed so you can see some informations about it. I can't find how can i do to simply open the "info window" on the map, by making a "hover" on the corresponding link. (and by the way, close all the others info windows) Did someone have an idea about this? Thanks a lot, have a nice day! :)

    Read the article

  • Google maps api v3 refreshing away markers

    - by Paul Peelen
    Hi, I am having problems with the google maps API V3. It seems that every time I load my page the maps load (including the markers) and then it does a quick reload and removes all the markers. Am I missing somehting? What am I doing wrong? Here is an example: http://www.PaulPeelen.com/wp-content/uploads/2010/04/SafariScreenSnapz001.mov this is my code: <script type="text/javascript"> <!-- var hash = "{{$sHashLocal}}"; var webroot = "{{$webroot}}"; var map; function initialize() { var latlng = new google.maps.LatLng(59.32045, 18.066902); var myOptions = { zoom: 13, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); return map; } function getMarkerInfo (infowindow, rack_id) { // Get all the racks $.ajax({ type: "GET", url: webroot+"ajax/getRack/"+hash+"/"+rack_id, cache: false, dataType: "html", success: function(html) { $("#rack_"+rack_id).html(); infowindow.setContent(html); } }); } $(document).ready(function () { map = initialize(); function attachSecretMessage(marker, rack_id) { var infowindow = new google.maps.InfoWindow({ size: new google.maps.Size(50,50) }); google.maps.event.addListener(marker, 'click', function(){ var ret = '<div id="rack_'+rack_id+'" class="rackDiv"><div class="rackDivLoading"><img src="theme/images/loader-small.gif" border="0"/><span>Hämtar data</span></div></div>'; infowindow.setContent(ret); infowindow.open(map,marker); getMarkerInfo(infowindow,rack_id); }); } function addPlacemark (lat,lng,title, rack_id) { var image = new google.maps.MarkerImage('http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png', new google.maps.Size(32, 32), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var shadow = new google.maps.MarkerImage('http://maps.google.com/mapfiles/shadow50.png', new google.maps.Size(37, 34), new google.maps.Point(0,0), new google.maps.Point(-4, 34)); var location = new google.maps.LatLng(lat,lng); var marker = new google.maps.Marker({ position: location, map: map, icon: image, shadow: shadow}); marker.setTitle(title); attachSecretMessage(marker, rack_id); } // Get all the racks $.ajax({ type: "GET", url: webroot+"ajax/getRacks/"+hash, cache: false, dataType: "xml", success: function(xml) { // Add the results $(xml).find("station").each(function () { rack_id = $(this).find("rack_id").text(); title = $(this).find("description").text(); longitute = parseFloat($(this).find("longitute").text()); latitude = parseFloat($(this).find("latitude").text()); addPlacemark(latitude, longitute, title, rack_id); }); } }); $("#addMark").click(function () { addPlacemark (59.32045, 18.066902); }); // Set size setPageSize(); }); //--> </script> I hope somebody can help me. Best regards, Paul Peelen

    Read the article

  • NetworkImageView with InfoWindowAdapter

    - by Exception-al
    I'm having trouble trying to use Volley's NetworkImageView with an InfoWindow of Google Maps API v2. My markers shows an InfoWindow with an image fetched from the internet. As you know, the only way to do this is to show the InfoWindow and refresh it when finished downloading the image. So I need a way to know when the NetworkImageView have finished downloading the image so I can refresh that view. I'm looking for something like onLoadComplete Any ideas?

    Read the article

  • Delete old map markers and load new ones?

    - by pufAmuf
    I'm trying to delete the old markers and load new ones. Here is the code I have that loads certain markers on page load - no issues here: (function() { var customIcons = { 1: { icon: 'redmarker.png', shadow: 'markershadow.png' }, 2: { icon: 'purplemarker.png', shadow: 'markershadow.png' }, 3: { icon: 'silvermarker.png', shadow: 'markershadow.png' }, 4: { icon: 'goldmarker.png', shadow: 'markershadow.png' } }; window.onload = function(){ var MY_MAPTYPE_ID = 'custom'; var stylez = [ { "stylers": [ { "hue": "#00ccff" }, { "saturation": -100 }, { "lightness": 5 } ] },{ } ]; var latlng = new google.maps.LatLng(10, 10); var options = { zoom: 16, center: latlng, panControl: false, zoomControl: false, scaleControl: true, mapTypeControlOptions: { mapTypeIds: [MY_MAPTYPE_ID,google.maps.MapTypeId.SATELLITE] }, mapTypeId: MY_MAPTYPE_ID }; var map = new google.maps.Map(document.getElementById('map'), options); var styledMapOptions = { name: 'Map' }; var jayzMapType = new google.maps.StyledMapType(stylez, styledMapOptions); map.mapTypes.set(MY_MAPTYPE_ID, jayzMapType); var infoWindow = new google.maps.InfoWindow; // Change this depending on the name of your PHP file downloadUrl("getxml.php", function(data) { var xml = data.responseXML; var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { var name = markers[i].getAttribute("id"); var address = markers[i].getAttribute("id"); var type = markers[i].getAttribute("venue_type"); var point = new google.maps.LatLng( parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng"))); var html = "<b>" + name + "</b> <br/>" + address; var icon = customIcons[type] || {}; var marker = new google.maps.Marker({ map: map, position: point, icon: icon.icon, shadow: icon.shadow }); bindInfoWindow(marker, map, infoWindow, html); } }); //BUTTON SWITCHING //////////////////////////////////////////////////////////// //BUTTON SWITCHING //////////////////////////////////////////////////////////// //BUTTON SWITCHING //////////////////////////////////////////////////////////// //BUTTON SWITCHING //////////////////////////////////////////////////////////// //BUTTON SWITCHING //////////////////////////////////////////////////////////// //BUTTON SWITCHING //////////////////////////////////////////////////////////// //BUTTON SWITCHING //////////////////////////////////////////////////////////// jQuery(document).delegate(".topCanBeActive", "click", function( e ) { e.preventDefault(); jQuery(".topCanBeActive").removeClass("topActive"); jQuery(this).addClass("topActive"); switch( this.id ){ case 'all_activity_button': alert("search"); break; case 'events_button': downloadUrl("getxml2.php", function(data) { var xml = data.responseXML; var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { var name = markers[i].getAttribute("id"); var address = markers[i].getAttribute("id"); var type = markers[i].getAttribute("venue_type"); var point = new google.maps.LatLng( parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng"))); var html = "<b>" + name + "</b> <br/>" + address; var icon = customIcons[type] || {}; var marker = new google.maps.Marker({ map: map, position: point, icon: icon.icon, shadow: icon.shadow }); bindInfoWindow(marker, map, infoWindow, html); } }); break; case 'venues_button': alert("venues"); break; case 'search_button': alert("search"); break; } }); //END //////////////////////////////////////////////////////////// //END //////////////////////////////////////////////////////////// //END //////////////////////////////////////////////////////////// //END //////////////////////////////////////////////////////////// //END //////////////////////////////////////////////////////////// //END //////////////////////////////////////////////////////////// //END //////////////////////////////////////////////////////////// //END //////////////////////////////////////////////////////////// } function bindInfoWindow(marker, map, infoWindow, html) { google.maps.event.addListener(marker, 'click', function() { infoWindow.setContent(html); infoWindow.open(map, marker); }); } function downloadUrl(url, callback) { var request = window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest; request.onreadystatechange = function() { if (request.readyState == 4) { request.onreadystatechange = doNothing; callback(request, request.status); } }; request.open('GET', url, true); request.send(null); } function doNothing() {} })(); Now, I created a button section where if you press one button, a different xml file is loaded. Notice the section with the ////////////////////// However, upon clicking the button, nothing happens. The xml file itself is okay and loads the desired data. I also receive no errors in firebug. Any ideas why this happens? Thanks!

    Read the article

  • Adding simple marker clusterer to google map

    - by take2
    Hi, I'm having problems with adding marker clusterer functionality to my map. What I want is to use custom icon for my markers and every marker has its own info window which I want to be able to edit. I did accomplish that, but now I have problems adding marker clusterer library functionality. I read something about adding markers to array, but I'm not sure what would it exactly mean. Besides, all of the examples with array I have found, don't have info windows and searching through the code I didn't find appropriate way to add them. Here is my code (mostly from Geocodezip.com): <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/markerclusterer/src/markerclusterer.js"></script> <style type="text/css"> html, body { height: 100%; } </style> <script type="text/javascript"> //<![CDATA[ var map = null; function initialize() { var myOptions = { zoom: 8, center: new google.maps.LatLng(43.907787,-79.359741), mapTypeControl: true, mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}, navigationControl: true, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); var mcOptions = {gridSize: 50, maxZoom: 15}; var mc = new MarkerClusterer(map, [], mcOptions); google.maps.event.addListener(map, 'click', function() { infowindow.close(); }); // Add markers to the map // Set up three markers with info windows var point = new google.maps.LatLng(43.65654,-79.90138); var marker1 = createMarker(point,'Abc'); var point = new google.maps.LatLng(43.91892,-78.89231); var marker2 = createMarker(point,'Abc'); var point = new google.maps.LatLng(43.82589,-79.10040); var marker3 = createMarker(point,'Abc'); var markerArray = new Array(marker1, marker2, marker3); mc.addMarkers(markerArray, true); } var infowindow = new google.maps.InfoWindow( { size: new google.maps.Size(150,50) }); function createMarker(latlng, html) { var image = '/321.png'; var contentString = html; var marker = new google.maps.Marker({ position: latlng, map: map, icon: image, zIndex: Math.round(latlng.lat()*-100000)<<5 }); google.maps.event.addListener(marker, 'click', function() { infowindow.setContent(contentString); infowindow.open(map,marker); }); } //]]> </script>

    Read the article

  • Create Marker Categories & Display Markers on Click Only

    - by MizAkita
    I am trying to create marker categories and display markers on click... For example, "Eat", "Banks", "Places of Interest" and clicking on them would produce only the markers in those categories. You can see it live HERE Here is a code snippet: //<![CDATA[ //<![CDATA[ var map = null; var gmarkers = []; var gicons = []; var icon = []; function initialize() { var myOptions = { zoom: 13, center: new google.maps.LatLng(37.979183,-121.302381), mapTypeControl: true, mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}, navigationControl: true, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); google.maps.event.addListener(map, 'click', function() { infowindow.close(); }); // Add markers to the map // Set up three markers with info windows ///////////////////////// EATS ////////////////////////////////////////////// var point = new google.maps.LatLng(37.988012,-121.311901); var image = 'icons/orangepointer.png'; var marker = createMarker(point,'<div style="width:205"><center><img src="icons/tigeryogurt.jpg" /></center><br><b>Tiger Yogurt</b><small><br>4343 Pacific Avenue<br>209.952.6042<br><br><a href="http://maps.google.com/maps?saddr=&daddr=' + point.toUrlValue() + '" target ="_blank">Get Directions<\/a></small><\/div>', image); // this will be gmarkers[0] var point = new google.maps.LatLng(37.987054,-121.311655); var image = 'icons/orangepointer.png'; var marker = createMarker(point,'<div style="width:205"><center><img src="icons/mwbakery.jpg" /></center><br><b>M&W Bakery<br>Cakes & Sandwiches</b><small><br>4343 Pacific Avenue<br>209.473.3828<br><br>On the web visit:<br><a href="http://www.mandwdutchamericanbakery.com" target ="_blank">MandWDutchAmericanBakery.com<\/a><br><br><a href="http://maps.google.com/maps?saddr=&daddr=' + point.toUrlValue() + '" target ="_blank">Get Directions<\/a></small><\/div>', image); // this will be gmarkers[1] Currently, all markers display. I can easily get the markers not to display... however, i am trying to have only categories display and individual listings to display on click only! CREATE MARKER FUNCTION: } var infowindow = new google.maps.InfoWindow( { size: new google.maps.Size(150,50) }); function triggerClick(i) { google.maps.event.trigger(gmarkers[i],"click") }; function createMarker(latlng, html, img) { var contentString = html; var marker = new google.maps.Marker({ position: latlng, map: map, icon: img, zIndex: Math.round(latlng.lat()*-100000)<<5 }); google.maps.event.addListener(marker, 'click', function() { infowindow.setContent(contentString); infowindow.open(map,marker); }); gmarkers.push(marker); }

    Read the article

  • Google maps API V3 code to V2 help.

    - by abemonkey
    I've started working on a project to inject markers into a map with jQuery by looping through rows on a table in the page. After getting it working I realized that I was accessing the V3 API and using V3 syntax. I've been beating my head against a wall trying to get this working in google maps API V2. If someone could please take a look at my code and help that would be great! Thanks! You can see my little test in action at www.axtsweapons.com/maptest.html. Here is the JS code: <script type="text/javascript"> $(function() { var latlng = new google.maps.LatLng(45.440000,-122.630000); var settings = { zoom: 12, center: latlng, disableDefaultUI: false, mapTypeControl:false, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), settings); $('tr').each(function(i) { var the_marker = new google.maps.Marker({ title: $(this).find('.views-field-title').text(), map: map, clickable: true, position: new google.maps.LatLng( parseFloat($(this).find('.views-field-latitude').text()), parseFloat($(this).find('.views-field-longitude').text()) ) }); var bounds = new google.maps.LatLngBounds(); var infowindow = new google.maps.InfoWindow({ content: $(this).find('.views-field-title').text() + $(this).find('.adr').text() }); new google.maps.event.addListener(the_marker, 'click', function() { infowindow.close(); infowindow.open(map, the_marker); }); }); }); </script>

    Read the article

< Previous Page | 1 2 3 4  | Next Page >