Draw layer dynamically and clickable

Hello,

We need to know if is possible draw dinamically layers using template tag, for example:

public layersobject[] = [
        {
            layerType: 'OSM',
            animationDuration: 0,
            markerSettings: [
                {
                    visible: true,
                    template:  '<div (click)="test()"  style="border: 2px solid gray; background-color: red; border-radius: 40px; height:10px;width:10px;"></div>'
,
                    dataSource: [{
                        name: 'Manhattan, New York, USA',
                        latitude: 40.7488758,
                        longitude: -73.9730091
                    }],
                    tooltipSettings: {
                        visible: true,
                        valuePath: 'name'
                    }
                }
            ]
        },
        
    ]; 

And execute a click event in this layer template to load details of this layer in other component, we only need to know if is possible apply event click in custom template or exists and other way to detects click on a layer.

Thanks!

2 Replies 1 reply marked as answer

SC Sergio cortes blanquez August 18, 2020 08:20 AM UTC

Hello,

I found the solution, using (markerClick) in ejs-maps directive. 



Thanks.


SM Sharmi Murugan Syncfusion Team August 19, 2020 06:17 PM UTC

Hi Sergio, 
  
Thank you for the update. 
  
Yes, we have markerClick event to notify the click event in the marker of the Maps control.  
  
Please let us know if you need any further assistance. 
  
Regards, 
Sharmi M. 


Marked as answer
Loader.
Up arrow icon