Posts Tagged ‘mapguide

18
Mar
14

Autodesk MapGuide 6.5 Retired But Still Downloadable

Here are the links to download MapGuide 6.5 Service Pack 1 (for now):

MapGuide ActiveX Control

MapGuide Author 6.5

MapGuide Server 6.5

MapGuide SDF Loader 6.5

MapGuide Raster Workshop 6.5

MapGuide Dynamic Authoring Toolkit 6.5

MapGuide Component Toolkit 6.5

 

Use at own risk as these products are no longer supported!  I have been continuing to consult with people to help move them to Autodesk Infrastructure Map Server 2014 or MapGuide Open Source – let me know if you need help migrating.

 

Advertisements
11
Jun
13

Autodesk Infrastructure Map Server – Auto-Zoom On Load

Whether you are using AIMS 2014 or MapGuide OpenSource 2.5, there is a way to automatically zoom and highlight objects.

I will do this demo using FUSION or Flexible Web Layouts.

We want to be able to pass parameters to the template like the following.

http://localhost/mapserver2014/fusion/templates/mapguide/slate/index.html?LAYERNAME=Roads&KEYNAME=ID&KEY=644,684&ISSTRING=1

The parameters are:

  • LAYERNAME
  • KEYNAME
  • KEY
  • ISSTRING

The LAYERNAME is the layer name in the map (i.e. Roads)
The KEYNAME is the column you want to search by (i.e. ID)
The KEY is the comma delimited list of matches (i.e. 644,684)
The ISSTRING flag tells whether the KEYNAME is String or Number.

I am using the SLATE template in MapGuide/AIMS, found in C:\Program Files\Autodesk\Autodesk Infrastructure Web Server Extension 2014\www\fusion\templates\mapguide\slate\index.html

To start the process, we need to trigger a javascript function once the map is loaded, around line 174, add a call to a function called zoomToObject()

var initPanelHandler = function() {
zoomToObject();
if(isTaskPaneRegistered) return;

Next create a zoomToObject() function that will pass all the parameters to a PHP Page to get the selectionXML, (paste this above the var showOverviewMap = function() { line):

function zoomToObject()
{
var mapWidget = Fusion.getMapById('Map');
var SESSION =mapWidget.aMaps[0].getSessionID();
var MAPNAME = mapWidget.aMaps[0].getMapName();

var KEY=getParam('KEY');
var ISSTRING=getParam('ISSTRING');
var KEYNAME=getParam('KEYNAME');
var LAYERNAME=getParam('LAYERNAME');

//The GETSELECTIONXML.php returns the XML of selected features.
var AJAXURL = "/mapserver2014/GETSELECTIONXML.php?MAPNAME=" + MAPNAME;
AJAXURL = AJAXURL + "&SESSION=" + SESSION;
AJAXURL = AJAXURL + "&KEYNAME=" + KEYNAME;
AJAXURL = AJAXURL + "&LAYERNAME=" + LAYERNAME;
AJAXURL = AJAXURL + "&KEY=" + KEY;
AJAXURL = AJAXURL + "&ISSTRING=" + ISSTRING;

var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
mapWidget.setSelection(xmlhttp.responseText, true);
}
}
xmlhttp.open("GET",AJAXURL,true);
xmlhttp.send();

}

we also need the getParam() function to harvest the parameters sent to the page:


function getParam(sname)
{
var params = location.search.substr(location.search.indexOf("?")+1);
var sval = "";
params = params.split("&");
// split param and value into individual pieces
for (var i=0; i<params.length; i++)
{
temp = params[i].split("=");
if ( [temp[0]] == sname ) { sval = temp[1]; }
}
return sval;
}

Finally, the GETSELECTIONXML.php (I put this in the www folder of C:\Program Files\Autodesk\Autodesk Infrastructure Web Server Extension 2014\www\)

<?php

$configFilePath = "C:\Program Files\Autodesk\Autodesk Infrastructure Web Server Extension 2014\www\webconfig.ini";

$session = urldecode($_REQUEST["SESSION"]);
$mapName = urldecode($_REQUEST["MAPNAME"]);

$keyName = urldecode(stripslashes($_REQUEST["KEYNAME"]));
$layerName = urldecode(stripslashes($_REQUEST["LAYERNAME"]));
$isString = urldecode(stripslashes($_REQUEST["ISSTRING"]));

$key = urldecode(stripslashes($_REQUEST["KEY"]));

if($isString == true)
{
$key = $key . ',0';
$key = str_replace(",", "','", $key);
$key = "'" . $key . "'";
}

try

{
MgInitializeWebTier($configFilePath);

$userInfo = new MgUserInformation($session);

$siteConnection = new MgSiteConnection();

$siteConnection->Open($userInfo);

$featureService = $siteConnection->CreateService(2);

$resourceService = $siteConnection->CreateService(0);

$map = new MgMap($siteConnection);

$map->Open($mapName);

$queryOptions = new MgFeatureQueryOptions();

$queryOptions->SetFilter($keyName . " in (" . $key . ")");

$layer = $map->GetLayers()->GetItem($layerName);

$parcelDataResId = new MgResourceIdentifier($layer->GetFeatureSourceId());
$featureClassName = $layer->GetFeatureClassName();

$featureReader = $featureService->SelectFeatures($parcelDataResId, $featureClassName, $queryOptions);

$selection = new MgSelection($map);

$selection->AddFeatures($layer, $featureReader, 0);

$selectionXml = $selection->ToXml();

$selection->Save($resourceService, $map->GetName());

//dump the XML out to a JAVASCRIPT variable

echo $selectionXml;

}

catch (MgException $e)
{

echo $e->GetMessage();

echo $e->GetDetails();

}

?>


That’s it.  It will work with the sample data that comes with MapGuide and AIMS, Sheboygan, or with any map you wish.

This will work with any FUSION application (flexible web layout),  on any version of mapguide.  The only thing you have to change is this line:

$configFilePath = “C:\Program Files\Autodesk\Autodesk Infrastructure Web Server Extension 2014\www\webconfig.ini”;

Just point it to the correct www folder.

ZOOMTOOBJECT_MAPGUIDE

19
Mar
12

ContourGPS Video and MapGuide (AIMS 2012)

What is a ContourGPS camera?

A small light full HD video camera with GPS capabilities. The GPS adds speed, location and elevation to the picture. The GPS receiver automaps the three essentials up to four times per second. The GPS synchronizes with your video and displays a second by second replay via Google Maps, Bing or OpenStreetMaps.  All within the MapGuide/AIMS 2012 environment.

1. Upload Video and Associated GPS file to web server (code loads the GPS points into SQL Server and creates path in map).

2. Video list in Interface and choose video to watch.

3. Video plays and animated point follows the path in sync with the video.

30
Jan
12

Flow Arrows and Custom Linetypes in AIMS 2012 (aka MapGuide)

So a lot of people want to recreate the look and feel of the maps they created in AutoCAD, even though precise engineering drawings are not cartographically accurate.

That being said there is definely a way to recreate the flow arrows and Leaders from AutoCAD in AIMS.

If you have a line layer in AutoCAD you will either have to export it to SDF, SHP, Oracle Spatial, SQL Server Spatial, or any other “FDO” type data.

Connect to that data in AIMS and modify the layer style in AIMS 2012 Studio.

In the Style Lne dialog:

  1. Ensure to use “Map” units
  2. Chose your units (feet or meters typically)
  3. Under Symbol and Style, click Add Symbol.

 4. Under Select Symbol, choose Triangle.

5.  For height, type your height in feet or if you have it as a column in your data, choose that.

6. For width, do the same as step 5.

7. Click Advanced.

8. If you want to put an arrow at the beginning of the line, enter 0 for Offset from Start, do not type anything for “from end” and set the Repeat interval to 0.

9. For Rotation, enter: 90

If you change the Offset for the End to be 0 and the beginning empty, the arrow will appear at the other end of the line.
This is very effective for AutoCAD Leaders and Flow Arrows.  Also, you can use text instead of triangle, to get a custom line.
For example: Choosing Text instead of Triangle, you can repeat the text along the line to create a custom line time
The cool thing is you can do this in Map 3D 2012 as well, for any FDO based layer.
 Also, you can save as a .LAYER file, load back into AutoCAD Map 2011 and use the Publish to MapGuide to retro your advanced layer definition into MapGuide 2011.
 Normally you would have to hack around in XML to get this to work with MapGuide 2011.
 If you have Map 3D 2012 you can now create .LAYER files with all this neat stylization and use the .LAYER retroactively.
11
Nov
11

Dongjin Xing’s – Introduction to MapGuide Enterprise (circa MapGuide 2007) Programming

This Video was put on the Autodesk Developer Network (ADN) for MapGuide 2007 – it is a few years old, but it is a great introduction to programming with MapGuide in .NET.

17
Jun
10

Installing MapGuide Maestro on Mac OS X (MacBook Pro)

So I went to the download page for MapGuide Maestro and downloaded the Linux/Mac binaries:

http://trac.osgeo.org/mapguide/wiki/maestro/Downloads

And unzipped them to DOWNLOADS/MapGuideMaestro/  folder

The instructions said to run MONO.  Mono enables the .NET libraries on your Mac.  So I went to the site:

http://www.go-mono.com/mono-downloads/download.html

Downloaded the DMG for the Mono 2.6.4 – Intel Framework and installed Mono (defaults)

Now this is where it gets weird, I have to run TERMINAL to get it work.  This is like the DOS window in Windows (LINUX people know this environment well).

In Applications > Utilities > Terminal

Type: 

  • cd //
  • cd downloads/MapGuideMaestro/
  • mono Maestro.exe

And MapGuide Maestro opens!

But, I don’t want run Terminal this each time I want to run Maestro, so I can use Mac Automator.

So, open Applications > Automator

  • Choose Workflow
  • Drag and drop “Run Shell Script” into the Workflow
  • In the shell, remove “cat”
  • Type:
    • cd //
    • cd downloads/MapGuideMaestro/
    • mono Maestro.exe
  • To create a link on the desktop to run Maestro, click File > Save As
  • For Save As, enter:  MapGuideMaestro
  • For Where, ensure Desktop is selected
  • For File Format, choose Application
  • Click Save

You now have a Link on the Desktop that will open MapGuide Maestro!  

The only issue I have seen is that the PREVIEW modes do not work (except for previewing Web Layouts)..

26
Apr
10

OpenLayers 2.9 Problem with MapGuide Enterprise 2010

So I have had some issues with this new roll-out of OpenLayers 2.9. My maps are just “brown” without the Google, Yahoo, Bing or OpenStreetMaps underneath.
I fixed it by using the 2.8 version:

< script src=”http://openlayers.org/api/2.8/OpenLayers.js”&gt;

this fixes everything…I haven’t figured out what has changed yet…




Gordon Luckett

Arrow Geomatics Inc's Gordon Luckett

Contact

gordon dot luckett at arrowgeo dot com 1-519-837-9500 (Arrow Geomatics Inc.)

Checkout MapGuide Guy’s Youtube Channel

gordonluckett@twitter

  • GeoJSON is an open format with geometry. It's great when you can stream GeoJSON directly from your database. lnkd.in/dxutEZ3 $ 2 days ago
  • For utilities (ie water or electrical) the bridge between CAD and GIS is critical. Often, AutoCAD Map/Civil is the best way get DWG into GIS $ 1 week ago
  • Love that more public libraries are offering Lynda.com courses for free (i.e. New Westminster) lnkd.in/dJjwXXM $ 1 week ago