[mapguide-users] RE: Waiting until resources are loaded [No Viruses detected]

Jackie Ng jackie.ng at aecsystems.com.au
Tue Dec 19 19:40:42 EST 2006


Hi Tom,

There is a client-side js variable (mapInit : bool) deep inside the mapFrame
the says whether a map has been loaded. To my knowledge there is no similar
variable/function/class on the server-side.

So what I did was do a client-side wait on this variable to become true.
Once true then initiate your server-side script through redirect/xmlhttp
request.

Hope that helps.

- Jackie

-----Original Message-----
From: Tom Chadwin [mailto:tom.chadwin at nnpa.org.uk] 
Sent: Tuesday, 19 December 2006 8:14 PM
To: users at mapguide.osgeo.org
Subject: Waiting until resources are loaded [No Viruses detected]

Hello all

I am opening a page in the task pane which queries feature data in the
current session map. However, this page loads quicker than the mapframe.
This means that exceptions are thrown in the task pane.

I have got around via a horrible solution which hammers the server:

try {
	MgInitializeWebTier($configFilePath);
	$userInfo = new MgUserInformation($mgSessionId);
	$siteConnection = new MgSiteConnection();
	$siteConnection->Open($userInfo);
	$resourceService =
$siteConnection->CreateService(MgServiceType::ResourceService);
	$featureService =
$siteConnection->CreateService(MgServiceType::FeatureService);
	$map = new MgMap();
	$map->Open($resourceService, $mapName); } catch (MgException $e) {
	header("Location: nnpa_planning.php?SESSION=" . $mgSessionId .
"&nnpaRef=" . $_GET["nnpaRef"]);
}

In other words, if there is an exception, re-request the page. What is a
better way to do this? I have heard mention of a variable which indicates
whether the map has fully loaded, but is that not in the Web API, and hence
in Javascript, and not available to the server-side script (in my case,
PHP)?

Any help gratefully received.

Tom


Tom Chadwin
ICT & Web Development Officer
Telephone: 01434 611530
Mobile: 
Fax: 01434 611677
Email: tom.chadwin at nnpa.org.uk
Web : www.Northumberland-national-park.org.uk
<http://www.Northumberland-national-park.org.uk>

<http://www.northumberland-national-park.org.uk/> 
 
____________________________________________________________________________
IMPORTANT NOTICE - Disclaimer - December 19, 2006 - REF
Email-200612-00057143.

If you have received this e-mail in error or wish to read our e-mail
disclaimer statement and monitoring policy, please refer to the statement
below or contact the sender. 
This communication is from Northumberland National Park Authority (NNPA).The
Authority's head office and principal place of business is Eastburn, South
Park, Hexham, Northumberland, NE46 1BS, United Kingdom.This communication
and any attachments contain information which is confidential and may also
be privileged. It is for the exclusive use of users at mapguide.osgeo.org. If
you are not the intended recipient(s) please note that any form of
disclosure, distribution, copying or use of this communication or the
information in it or in any attachments is strictly prohibited and may be
unlawful. If you have received this communication in error, please return it
with the title "received in error" to "it.security at nnpa.org.uk" then delete
the email and destroy any copies of it. 
E-mail communications cannot be guaranteed to be secure or error free, as
information could be intercepted, corrupted, amended, lost, destroyed,
arrive late or incomplete, or contain viruses. We do not accept liability
for any such matters or their consequences. Anyone who communicates with us
by e-mail is taken to accept the risks in doing so. 
Any views or opinions presented are solely those of the author and do not
necessarily represent those of NNPA.Contractors or potential contractors are
reminded that a formal Order or Contract is needed for NNPA to be bound by
any offer or acceptance of terms for the supply of goods or services
Although this email and any attachments are believed to be free of any virus
or other defects which might affect any computer or IT system into which
they are received, no responsibility is accepted by the NNPA for any loss or
damage arising in any way from the receipt or use thereof. Computer systems
of this Authority may be monitored and communications carried out on them
recorded, to secure the effective operation of the system and for other
lawful purposes.






More information about the Mapguide-users mailing list