BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
@(Html.EJ().Map("container") .Layers(lr => { lr.LayerType(Syncfusion.JavaScript.DataVisualization.Models.LayerType.Bing) .Key("mykey") .SubLayers(ssl => { ssl.ShapeData(mapData1) .ShapeSettings(ss => { ss.Fill("Blue") .StrokeThickness(0.5) .Stroke("Green"); }) .Add(); }) .Add(); }) |
Asp:
@(Html.EJ().Map("container")
.Layers(lr =>
{
lr.LayerType(LayerType.Bing).Key("AthrQ-lRLgDOIIN2rl6EaKZ5SIyvf1PvAidvJfIRjoVUVi9_XoVC9LYtWQOOJxP7")
.SubLayers(sl =>
{
sl.ShapeData(mapData)
.ShapeSettings(ss =>
{
ss.Fill("Blue")
.StrokeThickness(0.5)
.Stroke("Green");
}).Add();
}).Add();
})
)
|
ASP.NET MVC:
@(Html.EJ().Map("map")
//...
.ZoomSettings(zm =>
{
zm.EnableZoomOnSelection(true);
})
//...
// select shape using the navigateTo and selectShape methods
function buttonClick() {
var combo = $("#countriesCombo");
var index = combo[0].selectedIndex;
var lat = latLongPoints[index].latitude;
var lon = latLongPoints[index].longitude;
var level = 4;
$("#map").ejMap("navigateTo", lat, lon, level);
$("#map").ejMap("selectShape", latLongPoints[index].name, null, false);
}
|
{ "type": "FeatureCollection", "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, "features": [ { "type": "Feature", "properties": { "name": "cell1"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ 44.37704086303711, 35.42696613377983 ], [ 44.37952995300293, 35.43074278209167 ], [ 44.38193321228027, 35.430043416136144 ], [ 44.38201904296875, 35.42780540426507 ], [ 44.37704086303711, 35.42696613377983 ] ] ] } }, { "type": "Feature", "properties": { "name": "cell2"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ 44.37695503234863, 35.42703607332096 ], [ 44.381675720214844, 35.42549738938698 ], [ 44.3818473815918, 35.42360896438525 ], [ 44.379873275756836, 35.42311936549123 ], [ 44.37695503234863, 35.42703607332096 ] ] ] } } ] } |
HiAnas,
Thanks
for your update.
We
have analyzed query. We have prepared a sample with respect to your
requirement. In this we have added bing map to the background and then over
that OSM and over that your polygons. Kindly find the code snippet below,
[CS] @(Html.EJ().Map("container")
.Layers(lr =>
{
lr.LayerType(LayerType.Bing)
.ShapeData(worldData)
.SubLayers(sl =>
{
sl.LayerType(LayerType.OSM).Add();
sl.LayerType(LayerType.Geometry)
.ShapeData(polygon)
.ShapeSettings(ss =>
{
ss.Fill("Blue")
.StrokeThickness(5)
.Stroke("Green");
})
.Add();}).Add();
}) )} |
Screenshot:
For your reference we
have attached the sample. Find the sample from below link,
Sample
Location:http://www.syncfusion.com/downloads/support/forum/126236/ze/map_3layers-1792295616
As of now, we are facing
an issue while adding layers dynamically. So we have logged issue report for
this andfor better follow up, we
have created branch incidentunder
your account.
Please follow incident#165151for more details regarding
this.
Thanks,
Dharani.
[CSHTML]
@(Html.EJ().Map("container")
//. . . .
.Layers(lr =>
{
lr.SubLayers(sl =>
{
//. . . .
.ShapeSettings(ss =>
{
//Fill shape with opacity
ss.Fill("rgba(0, 0, 255, 0.4)")
//. . . .
}).Add();
//. . . .
}).Add();
//. . . .
})
)}
|
[CSHTML]
@(Html.EJ().Map("container")
.ClientSideEvents(events=>events.OnRenderComplete("renderComplete"))
. . . .
. . . .
)}
<script type="text/javascript">
var first = true;
function renderComplete(sender) {
//Zoom from the location corresponing to latitude and longitude co-ordinates 10 and -100
sender.model.centerPosition = [10, -100];
if (first) {
//Refresh the map
//container is the id used for creating the map in sample
$('#container').ejMap('refresh');
first = false;
}
}
</script> |