Domanda

When a user click on the marker an infowindow will appear and shows some information. It's better to show this information in a beautiful way by using table. How can I draw a table inside the infowindow?

Here is the loop-for that creates markers on the map and then create infowindow(s) for each one. I want to show تاریخ and ساعت and سرعت in a table to be aligned.

for(var counter = 0; counter < arrayLatitude.length; counter++)
    {
        var marker = new google.maps.Marker({
            position:new google.maps.LatLng(arrayLatitude[counter], arrayLongitude[counter]),
            info:arrayUTCdate[counter]+" :تاریخ<br>"+arraySatellite_derived_time[counter]+" :ساعت<br>"+arraySpeed[counter].toFixed(2)+" :سرعت"
            });

        marker.setMap(map);                                 

        //Event. When click on the marker, an infowindow show the content of specified marker.
        google.maps.event.addListener(marker, 'click', function () {
               infowindow.setContent(this.info);
               infowindow.open(map, this);
               });

    }
È stato utile?

Soluzione

Check this link : https://developers.google.com/maps/documentation/javascript/examples/infowindow-simple

you can set html here :

var contentString = '<div id="content">'       
  '</div>';
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top