Add Markers To Gmap

I create attach a Map to a Layout like that:

[code]var GMaps
var customparams = {
center: new google.maps.LatLng(44.383256,12.075348),
zoom: 11,
//disableDefaultUI: true,
mapTypeId: google.maps.MapTypeId.ROADMAP

//Carico la Mappa e i Parametri

The map is attached properly.
I have some places in a MySQL database through a function that is extracted in XML.
At this point, the code below should bring up the markers on the map, but it is not. The map continues to appear, but no markers.

[code]var customIcons = {
Ospedali: {
icon: ‘’,
shadow: ‘
bar: {
icon: ‘’,
shadow: ‘

var infoWindow = new google.maps.InfoWindow;
// Change this depending on the name of your PHP file
downloadUrl(“phpsqlajax_genxml.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(“name”);
var address = markers[i].getAttribute(“address”);
var type = markers[i].getAttribute(“type”);
var point = new google.maps.LatLng(
var html = “” + name + “
” + 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);, 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);
  };'GET', url, true);

Can you help please?


attachMap returns map object. Therefore, you may use GMaps to add markers in map.

Can I have an example, please?

Please see googlemap API

I have done today a bit researching in a similar issue and I will now share my result with you.

This code snipped below creates a map located on an address string (no knowledge of the latitude/longitude is needed) and will also create there a marker with an info window.

      var opts = {
          center: new google.maps.LatLng(47.349814818445935,8.275355100631714),
          zoom: 16,
          mapTypeId: google.maps.MapTypeId.ROADMAP
    GMaps = dhxLayout.cells('a').attachMap(opts);
      var geocoder = new google.maps.Geocoder();
      geocoder.geocode( { 'address': 'Sedova str. 80, Saint Petersburg, Russia'}, function(results, status) {
                  var marker = new google.maps.Marker({
                      position: results[0].geometry.location,
                      title:"dhtmlx Mailing Address"
                  var infowindow = new google.maps.InfoWindow({
                      content: '<b>dhtmlx</b>'