Note that there are some explanatory texts on larger screens.

plurals
  1. POCustomize Infobox Map Sql php
    primarykey
    data
    text
    <p>I would appreciate a hand hecharais I am trying to create a map connected with php and sql. My intention is to customize the "infobox" but I can not find the solution. This is in .js I wish you could help me. Thank you.</p> <pre><code> var map; function initialize() { var myOptions = { zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map'), myOptions); // Try HTML5 geolocation if(navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { var pos = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); var marker = new google.maps.Marker({ map: map, position: pos, icon:'images/bar.png', animation: google.maps.Animation.DROP, title: 'Location found using HTML5.' }); var infoWindow = new google.maps.InfoWindow; // Change this depending on the name of your PHP file downloadUrl("http://adricas.org/onferrol/mapa/phpsqlajax_genxml.php", function(data) { var xml = data.responseXML; var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i &lt; markers.length; i++) { var name = markers[i].getAttribute("name"); var address = markers[i].getAttribute("address"); var citystate = markers[i].getAttribute("citystate"); var phone = markers[i].getAttribute("phone"); var type = markers[i].getAttribute("type"); var info = markers[i].getAttribute("info"); var website = markers[i].getAttribute("website"); var point = new google.maps.LatLng( parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng"))); var html = "&lt;b&gt;" + name +"&lt;/b&gt; &lt;br/&gt;" + info + "&lt;/br&gt; &lt;a href="+website+"&gt;Zoom out&lt;/a&gt;" ; 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); } }); map.setCenter(pos); }, function() { handleNoGeolocation(true); }); } else { // Browser doesn't support Geolocation handleNoGeolocation(false); } } function handleNoGeolocation(errorFlag) { if (errorFlag) { var content = 'Error: The Geolocation service failed.'; } else { var content = 'Error: Your browser doesn\'t support geolocation.'; } var options = { map: map, position: new google.maps.LatLng(60, 105), content: content }; var infowindow = new google.maps.InfoWindow(options); map.setCenter(options.position); } </code></pre> <p>// Additional functions related to the 'other' DB Listing function</p> <pre><code>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() {} google.maps.event.addDomListener(window, 'load', initialize); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload