[mapguide-dev] FW: [mapguide-users] MgTileService - GetTile - Cannot establish connection

Walt Welton-Lair walt.welton-lair at autodesk.com
Fri Dec 8 12:53:10 EST 2006


We have to be careful exposing these because it introduces difficulties
in keeping the client and web-tier view states in sync.
 
Assume we expose Set methods on MgMap so the view can be manipulated on
the web-tier.  Some web-tier code calls the API and changes the view.
If you set these properties directly then the client and web-tier view
states are now out of synch.  Maybe you can get around this by tagging
these as pending changes - that adds complexity, but let's ignore this
for now.  Now that you've updated the view state on the web-tier you'll
want a way to sync the client to this view.  But you can't push this
information out to the client - it has to make a request to get this
information.  How to make that happen?  They will stay out of sync until
the client initiates another request.
 
Suppose while this was going on in the web-tier that the user panned the
view and the viewer made a request for updated graphics.  The request
includes the parameters that tell the web-tier what the updated view
should be.  Now you've got a request and can sync the views, but which
side wins?
 
There's also a problem of multiple refreshes.  In the case of DWF Viewer
here's how it could work.  The user clicks on a "Refresh" button and the
viewer makes a GetMapUpdate request.  The server responds with an
EMapTransaction DWF that could include information on updating the view
(it doesn't support that now, but that's one way to do it).   The viewer
would apply the updated view, but now it has to make another
GetMapUpdate request to get the updated graphics for the new view.  You
might ask why you can't include the updated graphics in the first
EMapTransaction DWF.  That because the viewer (at least for DWF) is
responsible for computing what data extent is needed.  After the view is
updated the viewer computes the new data extent and specifies that with
the second GetMapUpdate request.
 
Anyway, I feel like I'm starting to ramble here.  The point is that
making these view properties writable introduces a number of viewer /
web-tier interaction issues that would have to be addressed, and some of
these aren't trivial.
 
Walt

  _____  

From: Jason Birch [mailto:Jason.Birch at nanaimo.ca] 
Sent: Friday, December 08, 2006 5:43 PM
To: dev at mapguide.osgeo.org
Cc: Trevor Wekel
Subject: [mapguide-dev] FW: [mapguide-users] MgTileService - GetTile -
Cannot establish connection


It makes sense to me to expose these additional objects.
 
Anyone else have any insight or preference one way or another?  There
doesn't appear to be a functional barrier here; it just feels a bit odd
to me that there are properties of an object that are only available
through an HTTP call.
 
Are there any other objects that are hidden from the Web API that could
benefit from exposure?
 
Jason
 
  _____  

From: Trevor Wekel
Sent: Friday, December 08, 2006 08:23
To: Jason Birch; users at mapguide.osgeo.org
Subject: RE: [mapguide-users] MgTileService - GetTile - Cannot establish
connection


Hi Jason,
 
This was a deliberate exclusion.  There are a number of codependant
state variables in MgMap - like center, scale, and mapExtent.  Allowing
set access to any one variable would invalidate the others.  There are
two other objects in C++ - MgHtmlController and MgDwfController which
correctly manage the codependence.  The mapagent uses these classes.
 
There are use cases where the controllers would be useful for
manipulating MgMap state.  They could be exposed publically but the
documentation would need to be updated and the exposed methods would
have to be reviewed.  Some of the methods are no longer in use and
should be removed.  
 
I'm sure other members of the dev community and the PSC would like to
discuss this further.
 
Thanks,
Trevor
 
 

  _____  

From: Jason Birch [mailto:Jason.Birch at nanaimo.ca] 
Sent: Thursday, December 07, 2006 4:54 PM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] MgTileService - GetTile - Cannot establish
connection


I'm surprised that there are methods which are available to the MapAgent
but not the APIs.  
 
Was this a case of deliberate exclusion, or not enough time to get
everything in?  I can see there being some arguments for not exposing
these methods (only need them for rendering, etc) but there are
apparently going to be some use cases for accessing them :)
 
Jason

  _____  

From: Walt Welton-Lair 
Sent: Thursday, December 07, 2006 15:47
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] MgTileService - GetTile - Cannot establish
connection


Sorry about that - I forgot that the Set methods weren't exposed.
 
As Alain mentioned, currently the only way to update the view is via
certain HTTP requests.  GETMAP / GETMAPUPDATE / GETPLOT are used in the
context of DWFViewer, while GETMAPIMAGE and GETVISIBLEMAPEXTENT are used
in the context of AJAX Viewer.  You can include additional parameters
with any of these requests to update view related information:
 
    SETDISPLAYDPI=<dpi>
    SETDISPLAYWIDTH=<width>
    SETDISPLAYHEIGHT=<height>
    SETVIEWSCALE=<scale>
    SETVIEWCENTERX=<centerX>
    SETVIEWCENTERY=<centerY>

While you can use a viewer to make these requests for you, you can make
the HTTP requests yourself and get the same effect.  You could write an
application that:
 
1) creates a session
2) creates an MgMap for your MapDefinition that is part of your session
3) makes one of the HTTP requests above
    - GETVISIBLEMAPEXTENT is the simplest
    - include the SETVIEWSCALE parameter with the request to set the
scale you want
4) makes calls to GetTile
5) repeats steps 3 and 4 for each desired scale
 
For steps 1 and 2 there's should be sample code under the MgMap
documentation.
 
For step 3 something like .NET's HttpRequest class probably works.  Just
make the request to your MG server, e.g.
http:://localhost/mapguide/mapagent?OPERATION=GETVISIBLEMAPEXTENT&VERSIO
N=1.0.0&SESSION=<sessionId>&MAPNAME=<mapName>&SETVIEWSCALE=<scale>
 
Here, mapName is the name from the MgMap.
 
Walt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-internals/attachments/20061208/f0f2b242/attachment.html


More information about the Mapguide-internals mailing list