MapWindow 4 - Plugins : MapWindow Discussion Forum
Hello everyone, The MapWindow team has just completed developement of a new layout engine for the MapWindow 4 application. It is based on code developed for the new MapWindow 6 and should give you a taste of some of the new functionality that we are developing. The layout files gener
Pages: 1234567Next
Current Page: 1 of 7
MapWindow 4 Print Layout Plug-in
Posted by: bmarch ()
Date: August 11, 2009 02:24PM

Hello everyone,

The MapWindow team has just completed developement of a new layout engine for the MapWindow 4 application. It is based on code developed for the new MapWindow 6 and should give you a taste of some of the new functionality that we are developing. The layout files generated with this plug-in will be compatible with the layout engine that ships with MapWindow 6. When the plug-in is installed it replaces the default print behavior of MapWindow 4.

Features:

High resolution prints
Large paper size support
Automatic legend generation
Layering of map elements
Text, scale bar and bitmap support


We need a few beta testers to try it out and give us some feedback and let us know how it works on different datasets and with different printers.

You can download the beta release from here:

http://svn.mapwindow.org/svnroot/MapWindow4Dev/Bin/ApplicationPlugins/mwLayout/

Simply download the file and save it into:

"MapWindowInstallPath"\ApplicationPlugins\mwLayout\



Thanks,

Brian

[Edit:] Updated the download link



Edited 3 time(s). Last edit at 09/27/2009 01:49PM by pmeems.

Options: ReplyQuote
Re: MapWindow 4 Layout Plug-in
Posted by: pmeems ()
Date: August 12, 2009 12:55AM

Brain,

I'll test it for you. How do you want your feedback?
In this topic, via e-mail or in Mantis?

Here's my first try:
I'm using todays SVN version of MapWindow on WinXP sp3.
I've downloaded the layout.dll and copied it in the applicationplugins folder, as you suggested.
I hit the print button and a very nice form is opened. That looks very good and professional!
When I hit the 'Add Map' button I get a GDI+ error:
MapWindow GIS 4.7.2 (11-8-2009)
System.Runtime.InteropServices.ExternalException: Er is een generieke fout opgetreden in GDI+.
   bij System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
   bij System.Drawing.Image.Save(String filename, ImageFormat format)
   bij System.Drawing.Image.Save(String filename)
   bij mwLayout.LayoutMapMW4.Draw(Graphics g, Boolean printing)
   bij MapWindow.Layout.Elements.LayoutElement.UpdateThumbnail()
   bij mwLayout.LayoutMapMW4.set_Envelope(IEnvelope value)
   bij mwLayout.LayoutMapMW4..ctor(IMapWin MapWin)
   bij mwLayout.LayoutControlMW4.CreateMapElement()
   bij MapWindow.Layout.LayoutInsertToolStrip._btnMap_Click(Object sender, EventArgs e)

All other buttons seem to work just fine. I've inserted a textbox, image, rectangle and north arrow.
I also inserted a scale bar and legend but those are blank because I can't add a map.

This plug-in really looks and works great. If this is an example how v6 will be then I can't wait to use that as well!

Thanks,

Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: MapWindow 4 Layout Plug-in
Posted by: bmarch ()
Date: August 12, 2009 02:07PM

Hi Paul,

Just post the bugs in this thread for now.

I've fixed the one you posted. I was saving bitmaps for debugging to the c:\temp folder which I guess you don't have that was causing the exception.

Try it now, it should work!

Brian

Options: ReplyQuote
Re: MapWindow 4 Layout Plug-in
Posted by: jacksonmacd ()
Date: August 12, 2009 09:02PM

Brian
Very cool. A great addition to MW.

Installation was flawless -- I wan't sure that it was actually working (could not remember what the old version looked like), so I renamed the dll just to confirm that something had actually changed by installing the dll onto my computer. Could not have asked for a more seamless installation.

I created a layout, then clicked the "New" button. Was offered the chance to save the layout, which I accepted. However, it never asked for a filename, and using the "Open" button showed there were no .mwl files on the computer. It should either ask for a filename, or supply a default filename instead of just discarding the existing layout.

It's a bit misleading to have an editable field for the map scale in the sidebar. I tried changing the mapscale using that textbox before I discovered the toolbar button for zooming the map. It would be nice to be able to enter a map scale from the sidebar. Failing that, the textbox should be locked to prevent editing. Would also be nice to have a button that applies the current extents of the MW map to the current map on the layout window. I really like how the PanMap button remains active even after using the ZoomIn or ZoomOut buttons. Nice!

Alternating expanding and shrinking the size of the map on the layout (stretch either the top or side boundary of the box) causes the mapscale to be reduced. It should remain constant regardless of the map size.

The legend scalebar should show the numeric value of the scale in addition to the graphical representation.

The paper margins don't seem to *do* anything. First thing I did on a new layout was to reduce the margin size to use more of the paper. Are they necessary to show at all? If they are required, suggest that you change the default margins to something like 0.25 inch. (OOPS! Just discovered the View command to hide the margins! Maybe just default them to hidden.)

Printed successfully on a cheap-o Lexmark inkjet printer. I don't have any project work underway right now, so won't be able to give it a real-world workout.

Thanks again.

Options: ReplyQuote
Re: MapWindow 4 Layout Plug-in
Posted by: bmarch ()
Date: August 12, 2009 11:18PM

Thanks for the feedback jacksonmacd,

You right the new button is supposed to prompt you for a file name if the layout doesn't have one yet, so I'll take a look into that tomorrow.

I left the scale value on the map's property page to be read / write because I am planning on making it editable, I just haven't implemented it yet. Apply current map extent button is a great idea and wouldn't be hard to do at all, I'll see about adding it on the next release.

So you think that I should keep the maps scale static regardless of resizing, after having played with it more I think you're right. I wasn't to thrilled with the way it works now but I wasn't sure what to do about it, I like your idea, which I think would work well if the scale is a value the user can type in, they wouldn't want it to change everytime they resize the map.

Scale ratio like 1:100000 is a good idea, do you think it should be a seperate item you can add to the map or just underneath the current scale bar?

The margins at the moment do nothing, it just draws a line on the paper if you have them visible. I included them so that eventually we can add functionality like aligne to left margin, fit to margin etc... thats on the long term list of features. The size of the margin is actually whatever your printer specifies by default, since the paper size first selected when you open the layout is your printers default. For some reason every printer I've tested, except a plotter, has had 1 inch margins.

Thanks Brian

Options: ReplyQuote
Re: MapWindow 4 Layout Plug-in
Posted by: pmeems ()
Date: August 13, 2009 01:45AM

With the new version I got a GDI error again when adding the legend.
After I created the C:\Temp it was fixed. So you missed one ;)
I think it is best to save those temporarily files in the window temp folder using a temp name. System.IO has some methods for that.

I also noticed when saving the layout the initial folder isn't the folder of the project. Would be nice though.

It would also be nice if we could create some sort of template lay-out so we don't have to add all the objects every time again. Perhaps open the last used template when opening the lay-out form.
After dragging a rectangle for adding a bitmap I need to manually invoke the selection of a file. It would be nice to have the 'select bitmap dialog' after drawing the rectangle.

Should I add your plug-in to the weekly builds?
And I'm in the process of creating new installers (RC3) shall I add your plug-in to it as well. Then you'll get a big testing audience.

Thanks,

Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: MapWindow 4 Layout Plug-in
Posted by: bmarch ()
Date: August 13, 2009 02:03PM

Alright,

I've fixed the bug when creating a new layout, it now asks you where to save.
The scale field on the map is now editable and the map scale stays the same when resizing the map.

The scale bar now has a ratio on it.

and when you add a bitmap it now prompts you with a open file dialog.



Paul please do include it in the next weekly build.

Brian

Options: ReplyQuote
Re: MapWindow 4 Layout Plug-in
Posted by: jacksonmacd ()
Date: August 14, 2009 10:16AM

bmarch Wrote:
-------------------------------------------------------
>
> I left the scale value on the map's property page
> to be read / write because I am planning on making
> it editable, I just haven't implemented it yet.

That will be great!

>
> So you think that I should keep the maps scale
> static regardless of resizing, after having played
> with it more I think you're right. I wasn't to
> thrilled with the way it works now but I wasn't
> sure what to do about it, I like your idea, which
> I think would work well if the scale is a value
> the user can type in, they wouldn't want it to
> change everytime they resize the map.

I had not noticed until after posting that the main MW window exhibits the same behaviour. From an end-user's perspective, I would prefer to have the scale (1:xxxxx) remain constant as I resized the map window.


>
> Scale ratio like 1:100000 is a good idea, do you
> think it should be a seperate item you can add to
> the map or just underneath the current scale bar?

Under the current scale bar would be acceptable. Making a separate item would add just more "clutter" (no offence!).

I see that you asked Paul to include it with the weekly builds. That will be handy.

Thanks.
Jack

Options: ReplyQuote
Re: MapWindow 4 Layout Plug-in
Posted by: pmeems ()
Date: August 14, 2009 04:02PM

Jack, Brain,

I've added it as an optional plug-in in RC3 I created earlier this day.
Next week I'll include it in the weekly build as well.

The new installers are not available trough the download page because I don't have yet the correct credentials to do that. I'm working on that.

--
Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: MapWindow 4 Print Layout Plug-in
Posted by: bmarch ()
Date: August 17, 2009 10:20PM

Hi Everyone,

I've added support for picking which layers to add to the legend. And you can save it to, the next time you load the layout it will enable the layers at the same position as last time.

Brian

Options: ReplyQuote
Re: MapWindow 4 Print Layout Plug-in
Posted by: enrico chiaradia ()
Date: August 19, 2009 02:27AM

Well,
I copied the first version from the svn in the "MapWindowInstallPath"\ApplicationPlugins\mwLayout\" folder and it worked great (very good job, Brian!)
Today, I installed the latest version in the same way but MapWindow doesn't recognize it and show the old printing-form, very disappointing.

Did I miss something?

Thank you,

enrico

Options: ReplyQuote
Re: MapWindow 4 Print Layout Plug-in
Posted by: bmarch ()
Date: August 19, 2009 11:32AM

Hi Enrico,

The only file you should have in "MapWindowInstallPath\ApplicationPlugins\mwLayout" is layout.dll

My only suggestion is to delete everything in that folder and check layout.dll out of the svn again and place it back in that folder.

Are you using a copy of MapWindow from the svn or are you using version 4.6? (The latest stable release) This might sound silly but I frequently end up with several different copies of MapWindow installed on my computer in different folders, please make sure that the copy you are executing is the one with the layout.dll

The latest version was committed to the repository Aug 17th 5:39pm MT, its possible that the version before that didn't work.

Brian


Oh and just so everyone knows layouts saved with the previous version will not load properly in the new version because I had to make some changes to the file format.



Edited 2 time(s). Last edit at 08/19/2009 11:38AM by bmarch.

Options: ReplyQuote
Re: MapWindow 4 Print Layout Plug-in
Posted by: bmarch ()
Date: August 22, 2009 01:33AM

Hi Everyone,

So I think I've gotten a few more bugs sorted out:

- The color and textHint property of legends now do something!
- You can refresh the layout by hitting F5 or clicking view->refresh, this is especially useful if you added a layer to the map or changed its symbology since updating the layout every time the map is modified is out of the question do to how slow it would be.
- I hope I fixed the bug that was causing it to spew that failed to draw please close and reopen the layout error, fingers crossed.


Dr. Ames has asked me to produce some map to show off the new printing engine the other day and so I set about doing it using the new engine. One of the things that really started driving me nuts is the way the selection works. If you click and drag a rectangle it works as expected but if you single click, it selects every element under the mouse not just the one at the top. What do you guys think, should I leave it that way or modify it to just select the top most? The other thing I noticed is that your layout quickly starts looking a little sloppy without the ability to align elements with each other and to the margins, I think that will be my next big feature addition.

Please keep posting bugs as you find them and feature requests are welcome.

Brian

Options: ReplyQuote
Re: MapWindow 4 Print Layout Plug-in
Posted by: nomo ()
Date: August 22, 2009 10:01AM

Hi Brian
1st thank you. This team has and you have made my life easier. uknow what I'm talkin about.
I'm using this plugin to replace the printout maps from our previous AutoCad system. In that system we had multiple pages for our maps.

Do we have the option from this plugin to select sections of the entire map from a predetermined grid then print them out or preview the printout? This type of emulation would quell the naysayers (of GIS) period.

Options: ReplyQuote
Re: MapWindow 4 Print Layout Plug-in
Posted by: bmarch ()
Date: August 22, 2009 10:09AM

Hi Nomo,

At the moment, you can hit the zoom to full extent button. Which zooms the map you have selected in the layout to the full extent of all of the layers currently loaded. I don't think we can do exactly what you are describing, although honestly I'm not entirely sure I understand what type of functionality you are looking for. If you can give me a clearer description we might be able to set something up for you.

Brian

Options: ReplyQuote
Re: MapWindow 4 Print Layout Plug-in
Posted by: nomo ()
Date: August 22, 2009 10:41AM

hi Brian
At full extents the map of a community becomes 'littered' with labels and to print this out on paper it is unreadable. In AutoCad the entire map is devided into a grid like an atlas. Could you make it so that we could save a series of print layouts that represent the fullextents of a MWPRJ?
I hope this is clear and that I have explained the functionality I'm asking for.
I use MW to model the communities in Nunavut, Canada. Environment, Lines, Finamce, property, IT.... the list is growing.

Options: ReplyQuote
Re: MapWindow 4 Print Layout Plug-in
Posted by: bmarch ()
Date: August 22, 2009 11:35AM

Hi Nomo,

I see what you mean now. Are you trying to print an Atlas for all of Nunavut or just the communities around Iqaluit, because that is a really big area, you would likely need to create your atlas with many different scales, one for around communities and another for large unpopulated areas.

I think an Atlas builder might go beyond the scope of what we were trying to build with the layout engine. Its certainly very doable, but it would be a lot of work. As it is, the layout engine needs a few other basic features before we start adding fancy extras.

Why don't you contact me by e-mail and we can see how to best meet your needs.

Brian

bmarchionni "at" videotron "dot" ca

Options: ReplyQuote
Re: MapWindow 4 Print Layout Plug-in
Posted by: bmarch ()
Date: August 27, 2009 11:45AM

Hi everyone,

A bunch of new fixes:

Selections now work a little better, if you single left click a element it will select just the top most not everyone under the point.

Added support for aligning elements to each other and margins via a right click context menu.

Please try them out and let me know how they work.

Paul can you please include the new release in the next build, I wrote a little script to make creating the merged dll easier.

Brian

Options: ReplyQuote
Re: MapWindow 4 Print Layout Plug-in
Posted by: jacksonmacd ()
Date: August 27, 2009 10:38PM

Brian
Excellent! The alignment worked like a champ.

Regarding the request from Nomo - would this work?: put a button on the toolbar to zoom to the current extents of the actual MapWindow map. It would be the same extents as is displayed when you first add a map to the layout. I tried the "zoom to full extents", and found it less than helpful. Problem is that the map can have some points that cause its full extents to be much bigger than its "active" area. Once it's zoomed to the very large extents, its a PITA to zoom back into the correct extents using the ZoomIn tool (unless I am missing a capability to drag over a zoom area). Having a ZoomToMapWindowExtents button would resolve my problem.

It might also help with Nomo's problem because he could define some Bookmarked views of the areas that he wanted to preserve (... if I understand his request correctly).

Thanks for your work!

Options: ReplyQuote
Re: MapWindow 4 Print Layout Plug-in
Posted by: nomo ()
Date: August 28, 2009 06:29AM

Brian
Jacksonmacd is right. That would solve the problem. What i'm doing now is listing (on paper) the zoom level and positions of the current extents then panning to another position to test the effective area of the map. I then create a shapefile called 'grid' that I use to divide the area of interest into blocks which I then use my screen area to print out. It is labour intensive. The bookmark would remember where I was even after working with different zoom levels. If I work on a municipality within a greater area then I can define it's extent and lay the grid within those extents.
I must say this tool has been very helpful and I appreciate your work on this as I do the whole development team. You guys are making me look very good to my colleages. Thanks again.

Options: ReplyQuote
Pages: 1234567Next
Current Page: 1 of 7


Sorry, only registered users may post in this forum.





Banner Exchange




GISCP.com




Send us your banner logo (160x120) for the space above, and add this MapWindow banner ad to your site:

Just paste this text in your page: