wiki:CodeSamples/PHP/GeneralTasks

Version 3 (modified by amorsell, 16 years ago) ( diff )

--

This page is one of the MapGuide Community CodeSamples. Visit the CodeSamples page to view more!

General Tasks Example

The attached zip file contains the source code for the General Tasks example that can be seen on the MGOS example sites page: http://data.mapguide.com/mapguide/gt/index.php

From the included setup.txt file

In order to setup the application, you will need to:

  1. extract the gt.zip file in the www folder
  2. check the gtconstants.php file to validate the server path(s)
  3. load the Redding.mgp package
  4. create a user called Markup (password: markup) that has authoring priviledges

OR

create your own user with an Author role and edit the source code accordingly

  1. the generic task commands are invoke URL calls

-- Additional Notes from Steve G on the MGOS discussion list --

Here are my full instructions on how to get the shareable markups to work using MG 2.0.2.

  1. Extract GT.zip to folder called Markup in C:\Program Files\!MapGuideOpenSource2.0\WebServerExtensions\www

There are some extra files that you don’t need specifically for shareable markup tool (other tools in the GT sample application), but it won’t hurt to extract all the files here.

  1. Place gtconstants.php in C:\Program Files\!MapGuideOpenSource2.0\WebServerExtensions\www\phpviewersample
  1. Edit gtconstants: $INSTALL_DIR = 'C:
    Program Files
    MapGuideOpenSource
    ';

to

$INSTALL_DIR = 'C:
Program Files
!MapGuideOpenSource2.0
';

If you installed MG to another directory or if the default directory name changes, you will need to update this.

  1. Make sure that your coordinate system is set in your map. If not, you will get an error that says this:

Argument is null. Argument is null. Exception occurred in method MgCoordinateSystemCache.Get at line 120 in file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\common\geometry\CoordinateSystem/CoordinateSystemCache.cpp

Other Downloads

The Redding dataset that is already configured to use GT is available here. It is approximately a 15 MB download. Copy the file to your MGOS server packages folder and load the package via the Administration interface. View the web layout definition in your MGOS authoring tool of choice to see the custom commands already configured for the General Tasks. http://www.spatialgis.com/Redding.mgp

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.