Google Map Layer Add Infowindow and Map Type

Rogers Dwiputra7 years ago

Hi Anton, i'm new on ExtJS but i have experience in javascript and Google Map JS API, i want to add infowindow to Google Map Layer, but i'm not found Google Map code such as Google Map Initialization, Create Marker in web folder.

This is InfoWindow code that i usually use :

    var infowindow = new google.maps.InfoWindow({
      content: "Infowindow Content"
    });

    var marker = new google.maps.Marker({
      position: uluru,
      map: map,
      title: 'Uluru (Ayers Rock)'
    });
    marker.addListener('click', function() {
      infowindow.open(map, marker);
    });

Reference : https://developers.google.com/maps/documentation/javascript/examples/infowindow-simple

Thank You

Anton Tananaev7 years ago

Traccar doesn't use Google Maps API, so I'm not sure why you expect to find it.

Rogers Dwiputra7 years ago

Is it use openstreetmap ?

So if i add google map in custom layer it still use osm but the tile is from google map?

If that true, so to show infowindow maybe i can use this code

var infobox = new khtml.maplib.overlay.InfoWindow({content: "This is a marker-infobox!"});

marker.attachEvent( 'click', function() {
        infobox.open(map, this);
});

Reference : https://wiki.openstreetmap.org/wiki/Marker_API

Rogers Dwiputra7 years ago

Update :

After check some code, is traccar use OpenLayers to create Map, Add Marker and other map function ?

Reference : http://openlayers.org/en/latest/examples/popup.html & https://openlayers.org/en/latest/apidoc/ol.Map.html#addOverlay

Anton Tananaev7 years ago

Yes, Traccar uses OpenLayers.