Pentaho

 View Only

 CDE NewMapComponent - Google Marker onClick event

  • Pentaho
  • Ctools
  • Pentaho
David Martinez's profile image
David Martinez posted 04-10-2018 08:46

We have problems using NewMapComponent, Marker click Function don't works when Google MapEngine is selected. With Openlayers MapEngine works fine.

 

Example attached:

 

  • Simple map with a Marker, when clicked an alert pops up with marker's name. (openStreetMap).
  • Change Map Engine to Google, (put a valid API key) and try again ....

#Pentaho
#Ctools
David Martinez's profile image
David Martinez

Self awnser:

Finally, we maked it with an, I dont want to say "ugly" but "not pretty" workaround.

Set the map's operation mode as "just the map", and create markers in JS:

code

        var marker = new google.maps.Marker({

            position: new google.maps.LatLng(latitude,longitude),

            map: CDEmap,

            title: "Marker title"

          });

          marker.addListener('click', CDE_markerClickFunction);

latitude, longitude, CDEmap and CDE_markerClickFuncion are custom JS variables that have to be initialized.

Data Conversion's profile image
Data Conversion