From the course: Learning MapGuide Open Source

Creating application definitions - MapGuide Tutorial

From the course: Learning MapGuide Open Source

Start my 1-month free trial

Creating application definitions

- [Instructor] The application definition also called flexible web layouts, is a more complex web layout. Application definitions are built with fusion technology. The fusion refers to a fusion between map guide, and OpenLayers JavaScript framework. Using application definitions, you have many more tools including advanced client side measure tools. Let's create a application definition now. So under Web Layouts, we'll hit New Resource, and the very first item on the list is called Application Definition. So that is different than what a web layout is. A web layout is that basic web layout, where an application definition is that flexible or fusion one. So let's pick on that, and of course, before we start, it says, I need a map, we'll pick then an IMO map, there we are. So the very first thing you've got, our five flavors that we can choose from. We have Aqua, lime gold, maroon, slate, and turquoise yellow. These are rappers or designs that you can use that are pre-made for map guide. And there are various templates, and they're stored on the server on the map guide server. And you can choose whichever one you want. We can even try to look at them. So what I'm going to do is I'm just going to save this resource under Web Layouts, and I'm just going to call it Nanaimo-Application, just like that, Nananaimo-Application hit OK. And you can see it says slate now, we can hit the button that says Public URL. Let's go there. Now you may see this come up, if you're using an older version of Maestro which I am version 610, because map guides changed slightly. So don't panic, it's easy to fix, all you have to do is go to this definition right here, and where the word, Aqua appears, just change that to Amberson where the question mark is and hit Enter. It's just that Maestro hasn't caught up to the most recent version of map guide, that's all. So here we are inside of the flexible web blade or fusion we've got an overview map, which is basically by default uses the same map with a smaller scale. We could actually target a completely different map for the overview map if we want. So even as we zoom in, you'll see that the overview map is zooming in, in the background. It's using the same map, only at a different scale. That's a new thing with the application definition and fusion. The other thing you'll notice is we've got a lot more buttons, we've got a whole set of tools along the side, across the top, we've got all sorts of things called external providers, we'll get into that in a minute. We've got view, we can turn things on, so there's actually a task pane, that's dockable and moveable, there's a legend that appears, and then you can move that around as well, turn it off and turn it on, for bring that back out, and we have our selection panels. So whatever we selected, so if I zoom in here and select on a parcel, there we are, and so on, I could even select the multiple and pick what I want. The one thing you'll notice that there's no zoom to selection with the fusion, that's the one thing you'll notice. And also you will notice whether a layer is selectable or not in the legend. So those are some of the things you'll notice that are different. But everything else is pretty close to what it is. So let's change the flavor, now there's two ways of doing it, we can actually minimize this and go back into Maestro and pick lime gold, and we can move from there. And, oh, here's our URL, we can copy it, but you notice when I changed the lime gold is putting that question mark after the word lime gold. So we'll have to tweak that again, 'cause to get that same error template and after lime gold. So it's just that, like I said my Maestro's older than the current version of map guide, so it's one little tweak that I have but then I can give someone this URL. There we are, there's lime gold now look at the difference. Everything is docked on the right-hand side and the tasks, the selection, and the legend are all dockable, you can hide the whole thing like that but you can bring it back, but they're always available as one big unit, and all the toolbars are in three rows instead of along the side, that's the difference. Let's look at maroon, again we'll probably have to tweak our URL which I will, again and get used to this, but that's okay. And again, everything's docked on the right-hand side but here's the neat thing about the maroon one you can actually maximize by clicking on each of the items and hide them. And the whole thing is hideable with that little click right there. And then again the buttons are along the side, across the top, so you've got, I think this is called the file menu, the main menu, the side menu, and all these can be customized. You can change what the icons are, and that sort of thing. Okay, let's look at a couple more. Slate, slate is one of my favorites. Again, I have to change the little hipper sand good practice, slate, everything's stocked on the left but the slate is very simple, it's gray, you've got a legend, a selection and task pin doc on the left, you've got the overview map here, which I can close if I don't want it, this is probably the most common use of map guide fusion that I've seen, I think a lot of users like this particular layout, because then we've got our maps and our quick plot, everything available. Now, some of the things that are different with the flexible web layout, the measuring tools completely different. When you measure, you've get this dynamic tool, where you can actually see the units as you move your mouse. And that's because the open layers underneath that's the technology that's running map guide inside of fusion is open layers, it has a lot of power, so we can do things like that. I'll just finish that, I'll hit Stop. The other thing it has is things like a Quick plot and this is a really nice tool where you can actually set an orientation or landscape and you get out of north arrow and that sort of thing, and you can use advanced options and set the scale at which you want to print, so say you want 1-5,000, there it is, and maybe I even want to rotate the print to sort of go along that corridor and they hit Generate, and what will happen is it'll actually print a PDF dynamically, put a north arrow on, a legend, everything, a PDF from your maps. So these are some of the things that you can do, that you can't do inside of the basic web layout. Keep that in mind. So some really neat things like that, the dynamic measuring tool, the printing and so on. There's external providers, which we'll get into later. Okay, we've got another flavor to look at and that is the turquoise yellow. Let's go to that again I have to change my little Amber sand right there, but we're getting used to that. Here we go, and again, it's, dockable on the left, but they are tapped with every map always on as part of this, so there you are. So everything's docked and the colors are turquoise and yellow, it's an interesting color scheme. And you'll notice that if you put too many buttons in here for the scale of your map, it'll scroll over for all your buttons. So keep an eye on what sort of buttons you put in here because you could have all sorts of space issues. Now, remember you can always have dropdown boxes and sub menus, but here we are and we've got this wrapper that's called turquoise yellow. Okay, so those are the flavors you have, you've got the ability to pick whichever you'd like and launch it at any time and that URL is launchable and you have your main map. Now, remember we talked about a secondary map, we can make a map, that's an overview map and add it. And it would use that for the overview, we can override the initial view with an X, Y and a scale. We can change the selection color, just like we can do in the basic web layout, and we can have the selection as an overlay which gives you a different texture of selection and so on. And then there's all the widgets. So look at all the menus we have that we have the toolbar the file menu is the top one, that's the very first one, the task menu is the next one, then we've got the different toolbar, secondary, vertical and so on. So we've got all these different menu. So for example, we have the file menu is the very top one, we have a toolbar, so because we're looking at the turquoise yellow in this particular item, so let's sort of tie what these are back to the menu. So this top menu across the top, that's the file menu. The second one with quick plot in it, that is the tool bar, just the tool bar. This one was quick plot. The next one is the vertical one. That's this one right here, toolbar vertical, vertical select. Now there's no secondary menu in this particular wrapper. So that can change if you were using a different wrapper. So if I were to use something like the lime gold one where they're all stacked on top of each other, like this let's go back and show you the lime gold one you have one, two, three, and that's your secondary menu. There's no vertical menus that gets used instead. So you'd use the secondary, the file menu at the top and the status bar across the bottom the coordinates and so on. You can change them, the map contexts, that's the right click, and the task menu is in the task bar, what sort of tools show up? So if I go to the task bar, right here, under tasks and the drop down, these are the tools that show up. So you can have the buffer tool show up inside here and so on, so you get a task list. So that's all customizable by dragging and dropping buttons inside. So that's the customization. Normally you'd have a different type of title, you'd say welcome to Nanaimo and you hit Save, and then if I were to launch this again, or go back and refresh, you'll see Welcome to Nanaimo at the top here. So once you've created an application definition or flexible web layout, as it sometimes called you can simply launch your webpage with the go button. This URL will enable you to view your map, and all the associated tools such as measure, buffer and even the customized printing.

Contents