We have an information box on our map, and the user can select its location: upper right corner, lower left corner, etc. Is there a way to place a layer in a static location on the control, not relative to map coordinates?
Thanks,
Dib
We have an information box on our map, and the user can select its location: upper right corner, lower left corner, etc. Is there a way to place a layer in a static location on the control, not relative to map coordinates?
Thanks,
Dib
Hi Dib,
Thanks for your question!
I am not sure I understand your question. A layer is a container for features, and does not have location attribute so there would not be a way to place a layer at a specific location. Could you perhaps elaborate on what you are looking to achieve?
I want to have a information box on the screen. The user can select where it is to be displayed (upper right corner, lower left, etc).
Hello Dib,
The information box you are using is a control or a polygon? If it’s a control, why are you want to use a layer to put it?
If you need a polygon to show this box, you need know what’s the size of the box, then translate the size to the world coordinate and set as boundingbox to the layer, because the layer does not has the width and height property, layer always fit the full map but you will use boundingbox to control how big you want to show.
Regards,
Gary
OK, I figured out that I can use a LegendAdornmentLayer for what I want to do, but there is a problem. In creating the LegendItems, I create a TextStyle with a font size. However, when the legend draws, the text seems to scale based on the width of the LegendAdornmentLayer object. Is there a way to keep the text size from scaling?
Hello Dib,
Sorry for the inconvenience, the LegendItem text style does not obey the style setting is a know bug, we are working on that. Once we fixed it, you can update to the newest version and everything will be ok.
Regards,
Gary
Gary,
Is there a timeline on fixing the LegendItem text scaling issue?
Hello Dib,
Sorry for the long time waiting, I have sent a email to get the newest status of this issue, I will let you know as soon as I get the news.
Regards,
Gary
Gary,
Is there an update on this? If not, I need to start working on another solution for an on-map information box. The legend item seems to be a great solution, but without the proper text scaling I can’t get it to work.
Thanks
Hello Dib,
Could you please try the newest dll 6.0.170.0, I get the news we have fixed this problem.
Feel free to let us know if you still meet the problem.
Regards,
Gary
Downloaded .170 and referenced it (DesktopEdition and MapSuiteCore). I am now getting an error on this line of code:
layerWindElipse.InternalFeatures.Add("Polygon34k", New Feature(BaseShape.CreateShapeFromWellKnownData(polyText)))
When I switch back to v6.0 DLLs, it runs as expected. Do I need to do anything else when using the daily builds?
Hi Dib,
Can you supply the exception you received?
Please also let us know if you are using the 6.0.170.0 (Development) or the 6.0.0.170 (Production) builds.
Downloaded Desktop Edition Full .175 this morning, and it runs. However, the text scaling problem still exists. When I change the width of the LegendAdornmentLayer, the size of the text changes with it. The wider the layer, the bigger the text. This doesn’t occur with changing height, only width.
Dib,
I am not sure that you downloaded the version with the fix Gary mentioned.
Note that we have a 6.0.170.0 and a 6.0.0.170. The third and fourth values of the version number are different.
Builds with a value other than zero in the third value are Development builds = 6.0.170.0
Builds with a value other than zero in the fourth value are Production builds = 6.0.0.170
Any changes made to the control to resolve the text scaling would be found in the Development 6.0.175.0 version not the 6.0.0.175 version.
For more information on our Release Cycle and version number schema please see: wiki.thinkgeo.com/wiki/Map_S...ycle_Guide
Please try the 6.0.175.0 version and let us know if this resolves the scaling issue.
Details, details. That makes sense. DLed 6.0.175.0. When I run it, I get a evaluation expired error:
An error occurred creating the form. See Exception.InnerException for details. The error is: The evaluation has expired. Please contact ThinkGeo for purchasing option or an extension to the trial.
We have a full version license, and I am only seeing this with the development build, not the production build. Is there something I need to change on my end to get this to work?
Thanks
Hi Dib,
I have some additional details for you! You downloaded the Evaluation Version of the Development Dlls. You need to download the Full Version of the Development Dlls.
In the Customer Portal there are two sections: My Product Downloads and Evaluation Daily Builds.
You can download the Full Edition Development Dlls from the My Product Downloads - Daily Development Builds section of the HelpDesk site.
Went to My Products Downloads, DLed DesktopEditionFull6.0.177.0DllPackage.zip, extracted, and referenced DesktopEdition.Dll and MapSuiteCore.Dll. Now, when I run the app, two things occur: 1) Nothing displays on the map at startup. For this, there may be an exception being swallowed somewhere in the code, and 2) when I click to show a storm, which creates polygons and lines, I get ‘well known text is incorrect’ errors. This could be due to the map not initializing correctly in #1, but I don’t know of a reason why the map would no longer initialize or display correctly.
Here is the full text of one of the errors, and some examples of the text that was used to attempt to create the shapes. Note that this code/text works when running against the current release:
System.ArgumentException was unhandled
Message=The format of the well known text is incorrect.
Parameter name: wellKnownText
ParamName=wellKnownText
Source=MapSuiteCore
StackTrace:
at ThinkGeo.MapSuite.Core.BaseShape.LoadFromWellKnownData(String wellKnownText)
at ThinkGeo.MapSuite.Core.LineShape…ctor(String wellKnownText)
at Hurrevac2010.mapDraw_ThinkGeoV6.ShowPreviousTrack(Advisory theAdvisory) in C:\Users\Dib Oglesby\Documents\Visual Studio 2010\Projects\hurrevac-1-3\Hurrevac2010\Classes\Graphics Classes\mapDraw_ThinkGeoV6.vb:line 455
at Hurrevac2010.Storm.ShowPreviousTrack(Advisory theAdvisory) in C:\Users\Dib Oglesby\Documents\Visual Studio 2010\Projects\hurrevac-1-3\Hurrevac2010\Classes\Storm Classes\Storm.vb:line 1076
at Hurrevac2010.Hurrevac2010.TEST_ShowStormShapes(Storm theStorm, StormCollection storms) in C:\Users\Dib Oglesby\Documents\Visual Studio 2010\Projects\hurrevac-1-3\Hurrevac2010\Forms\Hur2010Form.vb:line 7834
at Hurrevac2010.Hurrevac2010.ArchiveTreeView_AfterSelect(Object sender, EventArgs e) in C:\Users\Dib Oglesby\Documents\Visual Studio 2010\Projects\hurrevac-1-3\Hurrevac2010\Forms\Hur2010Form.vb:line 6920
at Syncfusion.Windows.Forms.Tools.TreeViewAdv.OnAfterSelect(EventArgs e)
at Syncfusion.Windows.Forms.Tools.TreeViewAdv.SetSelectedNode(ArrayList nodesToAdd, ArrayList nodesToRemove, TreeViewAdvAction action, Boolean fireEvent, Boolean forceRemove)
at Syncfusion.Windows.Forms.Tools.TreeViewAdv.set_SelectedNode(TreeNodeAdv value)
at Hurrevac2010.Hurrevac2010.ArchiveTreeView_AfterCheck(Object sender, TreeNodeAdvEventArgs e) in C:\Users\Dib Oglesby\Documents\Visual Studio 2010\Projects\hurrevac-1-3\Hurrevac2010\Forms\Hur2010Form.vb:line 6257
at Syncfusion.Windows.Forms.Tools.TreeViewAdv.OnAfterCheck(TreeNodeAdvEventArgs e)
at Syncfusion.Windows.Forms.Tools.TreeNodeAdv.set_CheckState(CheckState value)
at Syncfusion.Windows.Forms.Tools.TreeNodeAdv.ToggleCheckState(Boolean multiNodeToggle)
at Syncfusion.Windows.Forms.Tools.TreeNodeAdv.ProcessMouseDown(Point pt)
at Syncfusion.Windows.Forms.Tools.TreeViewAdv.OnMouseDown(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at Syncfusion.Windows.Forms.ScrollControl.WndProc(Message& msg)
at Syncfusion.Windows.Forms.Tools.TreeViewAdv.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at Hurrevac2010.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at System.Activator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.ArgumentException
Message=The format of the well known text is incorrect.
Parameter name: wellKnownText
ParamName=wellKnownText
Source=MapSuiteCore
StackTrace:
at ThinkGeo.MapSuite.Core.BaseShape.CreateShapeFromWellKnownData(String wellKnownText)
at ThinkGeo.MapSuite.Core.LineShape.LoadFromWellKnownDataCore(String wellKnownText)
at ThinkGeo.MapSuite.Core.BaseShape.LoadFromWellKnownData(String wellKnownText)
InnerException: System.DllNotFoundException
Message=Unable to load DLL ‘SqlServerSpatial110.dll’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Source=Microsoft.SqlServer.Types
TypeName=""
StackTrace:
at Microsoft.SqlServer.Types.GLNativeMethods.IsValid(GeoMarshalData g, Boolean& result)
at Microsoft.SqlServer.Types.GLNativeMethods.IsValid(GeoData g)
at Microsoft.SqlServer.Types.SqlGeometry.IsValidExpensive()
at Microsoft.SqlServer.Types.SqlGeometry…ctor(GeoData g, Int32 srid)
at Microsoft.SqlServer.Types.SqlGeometry.Construct(GeoData g, Int32 srid)
at Microsoft.SqlServer.Types.SqlGeometry.GeometryFromText(OpenGisType type, SqlChars text, Int32 srid)
at Microsoft.SqlServer.Types.SqlGeometry.STGeomFromText(SqlChars geometryTaggedText, Int32 srid)
at ThinkGeo.MapSuite.Core.BaseShape.CreateShapeFromWellKnownData(String wellKnownText)
InnerException:
Examples:
layerPreviousTrack.InternalFeatures.Add(New Feature(New LineShape(linePoints)))
where linePoints = “LINESTRING (-65.7 31.5, -65.7 30.8)”
layerWindElipse.InternalFeatures.Add(“Polygon34k”, New Feature(BaseShape.CreateShapeFromWellKnownData(polyText)))
where polyText = “POLYGON((-71.69501 47.43375, -70.84421 47.76202, -70.2342 47.96246, -69.34541 48.24448, -68.2283 48.35141, -67.32742 47.96757, -66.46072 47.45, -65.63602 46.82769, -64.93779 46.10167, -64.36764 45.3, -64.5014 44.44333, -64.83292 43.55569, -65.54163 42.74166, -66.38614 42.00035, -67.43147 41.457, -68.49268 41.07091, -69.50694 40.8208, -70.45224 40.72064, -71.30001 40.76667, -72.1022 40.96685, -72.91125 41.27499, -73.48455 42.00911, -74.23033 42.38903, -74.58656 43.0931, -74.73252 43.77501, -74.70262 44.38225, -74.49259 44.89772, -74.12609 45.3, -73.45902 45.57205, -72.82167 45.71043, -72.63174 45.89167, -72.41679 46.04992, -72.45671 46.44907, -72.35394 46.88771, -72.11503 47.336, -71.69501 47.43375 ))”
Am I doing something wrong when referencing the Dlls? Do I need to reference additional ones due to the development nature? Are the incorrect text errors due to the failure of the map to initialize at startup? If so, what would be causing the map to do that, that is different from the current release?
If you need more info, please let me know.
Hi Dib,
You are now experiencing the possible issues that can occur with Development - type dlls!
With the 6.0.36.0 version we made a change to what Geometry Library that is used by default.
This is all explained at the following link to our News and Announcements section of the Discussion Forums:
gis.thinkgeo.com/Support/Dis...fault.aspx
The main issue is that with the 6.0.36.0 and newer versions we are defaulting to the new unmanaged geometry functions that are provided in the SQLServerSpatial110.dll. You will see in your stack trace that there is an Unable to Load Dll message referring to this dll.
So how to get the latest version of the Map Suite dlls to work in your application?
The easist way would be to set your application to use the Managed GeometryLibrary that was the default before the 6.0.36.0 version.
You can do this with the following line of code:
BaseShape.GeometryLibrary = GeometryLibrary.Managed;
All set, all good. Thanks for the help
You are welcome.