Greetings!
I applied restricted extent in script section and pan fuctionality does not respond.
<text> <script language ="javascript" >
Map1.restrictedExtent = new OpenLayers.Bounds(-51, 121, 149, -13)
</text>
</script> </text>
The restricted extent is the same as current extent.
Zoom in and zoom out works as expected.
When I zoom in and then try to pan with mouse - no response.
What is required to make pan with mouse responsive?
I added another InMemoryFeatureLayer just to show extent
Dim extentLayer As New InMemoryFeatureLayer
extentLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.StandardColors.Transparent, GeoColor.StandardColors.Red)
extentLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
extentLayer.InternalFeatures.Add("Extent", New Feature(New RectangleShape(-51, 121, 149, -13)))
overlay.Layer(extentLayer)
Not sure why extent rectangle does not draw completely.
As you can see there is a space between extent rectangle and the map edges.
In desktop edition if I set Map ZoomLevelSnapping = ZoomLevelSnappingMode.None then space disappears.
Is it possible to eliminate space in MVC edition?
Here is sample code based on CreateAnInMemoryFeatureLayer.vbhtml
@Imports ThinkGeo.MapSuite.Core
@Imports ThinkGeo.MapSuite.MvcEdition
<div class="four columns" id="navigation">
@Code
Html.RenderPartial("SourceCode")
End Code
<div id="instrux-body">
<div id="instrux-text">
This sample simply adds an InMemoryFeatureLayer.
div>
div>
div>
<div class="twelve columns" id="main">
<div>
@Code
With Html.ThinkGeo().Map("Map1", New System.Web.UI.WebControls.Unit(100, System.Web.UI.WebControls.UnitType.Percentage), 510)
.MapBackground(New BackgroundLayer(New GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"))))
.MapUnit(GeographyUnit.DecimalDegree)
.CurrentExtent(-51, 121, 149, -13)
.StaticOverlay(Sub(overlay)
Dim inMemoryLayer As InMemoryFeatureLayer = New InMemoryFeatureLayer()
inMemoryLayer.InternalFeatures.Add("Polygon", New Feature(BaseShape.CreateShapeFromWellKnownData("POLYGON((10 60,40 70,30 85, 10 60))")))
inMemoryLayer.InternalFeatures.Add("Multipoint", New Feature(BaseShape.CreateShapeFromWellKnownData("MULTIPOINT(12 20, 30 20,40 20, 12 30, 30 30, 40 30)")))
inMemoryLayer.InternalFeatures.Add("Line", New Feature(BaseShape.CreateShapeFromWellKnownData("LINESTRING(60 60, 70 70,75 60, 80 70, 85 60,95 80)")))
inMemoryLayer.InternalFeatures.Add("Rectangle", New Feature(New RectangleShape(65, 30, 90, 15)))
inMemoryLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.FillSolidBrush.Color = GeoColor.FromArgb(100, GeoColor.StandardColors.RoyalBlue)
inMemoryLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.OutlinePen.Color = GeoColor.StandardColors.Blue
inMemoryLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle.OuterPen = New GeoPen(GeoColor.FromArgb(200, GeoColor.StandardColors.Red), 5)
inMemoryLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.SymbolPen = New GeoPen(GeoColor.FromArgb(255, GeoColor.StandardColors.Green), 8)
inMemoryLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
overlay.Layer(inMemoryLayer)
Dim extentLayer As New InMemoryFeatureLayer
extentLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.StandardColors.Transparent, GeoColor.StandardColors.Red)
extentLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
extentLayer.InternalFeatures.Add("Extent", New Feature(New RectangleShape(-51, 121, 149, -13)))
overlay.Layer(extentLayer)
End Sub
).Render()
End With
End Code
<script language ="javascript" >
Map1.restrictedExtent = new OpenLayers.Bounds(-51, 121, 149, -13)
script>
div>
div>