<div style="height:600px;width:900px;"> @(Html.EJ().Map("container") .Layers(lr => { lr.LayerType(Syncfusion.JavaScript.DataVisualization.Models.LayerType.Bing) .Key("AhJdl18HYFR7_JMICmMv1QJGHDyiDQqPTTeTDq5I29whbZLOTDrS__dF1WmKNB8a") .EnableSelection(false) .SubLayers(sl => { sl.LayerType(LayerType.Geometry) .ShapeData(mapData1) .EnableSelection(true) .ShapeSettings(ss => { ss.Fill("Blue") .StrokeThickness(0.5) .Stroke("Green"); }) .Add(); }) .Add(); }) .ClientSideEvents(e => e.ShapeSelected("shapeSel")) ) </div> |
{ "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": {}, "geometry": { "type": "Polygon", "coordinates": [ [ [ -97.57155418395996, 35.437666177347005 ], [ -97.57155418395996, 35.452490031428646 ], [ -97.54915237426758, 35.452490031428646 ], [ -97.54915237426758, 35.437666177347005 ], [ -97.57155418395996, 35.437666177347005 ] ] ] } }, { "type": "Feature", "properties": {}, "geometry": { "type": "Polygon", "coordinates": [ [ [ -97.54554748535156, 35.43409965413408 ], [ -97.54554748535156, 35.435987833161484 ], [ -97.54237174987793, 35.435987833161484 ], [ -97.54237174987793, 35.43409965413408 ], [ -97.54554748535156, 35.43409965413408 ] ] ] } } ] } |
ASP.NET MVC
<div style="height:600px;width:900px;">
@(Html.EJ().Map("container")
.Layers(lr =>
{
lr.LayerType(Syncfusion.JavaScript.DataVisualization.Models.LayerType.Bing)
.Key("AhJdl18HYFR7_JMICmMv1QJGHDyiDQqPTTeTDq5I29whbZLOTDrS__dF1WmKNB8a")
.EnableSelection(false)
.SubLayers(sl =>
{
sl.LayerType(LayerType.Geometry)
.ShapeData(mapData1)
.EnableSelection(true)
.ShapeSettings(ss =>
{
ss.Fill("Blue")
.StrokeThickness(5)
.Stroke("red")
.SelectionStroke("purple")
.SelectionStrokeWidth(10);
})
.Add();
})
.Add();
})
.ClientSideEvents(e => e.ShapeSelected("shapeSel"))
)
</div>
<script>
function shapeSel(sender) {
alert("shape is selected")
}
</script>
|