Changes between Version 9 and Version 10 of MapGuideRfc118


Ignore:
Timestamp:
07/12/11 22:40:23 (13 years ago)
Author:
wuma
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MapGuideRfc118

    v9 v10  
    146146One thing that needs attention is: A Base64 string might have “=” appended at the end for alignment. But “=” is treated as a reserved character. The solutions is: we remove all appending “=” when doing encoding, and then append them back when doing decoding
    147147
     148 6. '''Make Quick Plot Support IPv6'''
     149Quick Plot calls Http API to generate the map picture on Web Server. The code is like below (in PHP):
     150{{{
     151// Get the correct port number
     152// Just use the 127.0.0.1 specificly to point to localhost. Because the WebExtension will
     153// be always on the same server with map agent.
     154$mapAgent .= "://127.0.0.1:" . $_SERVER["SERVER_PORT"];
     155// Get the correct virtual directory
     156$mapAgent .= substr($_SERVER["REQUEST_URI"], 0, strpos($_SERVER["REQUEST_URI"], "/", 1));
     157$mapAgent .="/mapagent/mapagent.fcgi?VERSION=1.0.0&OPERATION=GETMAPIMAGE" .
     158            "&SESSION=$sessionID" .
     159            "&MAPNAME=" . rawurlencode($mapName) .
     160            "&FORMAT=PNG" .
     161            "&SETVIEWCENTERX=" . $center->GetX() .
     162            "&SETVIEWCENTERY=" . $center->GetY() .
     163            "&SETVIEWSCALE=$scaleDenominator" .
     164            "&SETDISPLAYDPI=$printDpi" .
     165            "&SETDISPLAYWIDTH=$toSize->width" .
     166            "&SETDISPLAYHEIGHT=$toSize->height" .
     167            "&CLIP=0";
     168
     169$image = imagecreatefrompng($mapAgent);
     170}}}
     171It uses '''{{{127.0.0.1}}}''' explicitly to connect to the Web Extension. There reason why it was implemented this way is like below:
     172The url is actually a self-referencing URL (the http request is sent and responded by a same host). So the first idea would be just use '''{{{LOCALHOST}}}''' to connect to the Web Extension. But the problem is the php function '''{{{imagecreatefrompng(url)}}}''' will run into error if the  the url contains '''{{{LOCALHOST}}}'''. So this solution doesn’t work.
     173The second idea would be use '''{{{$_SERVER[“SERVER_NAME”]}}}''' to get the host name at runtime. But it doesn’t work if the Web Extension Server is behind a proxy Http server. In this case '''{{{$_SERVER[“SERVER_NAME”]}}}''' will be the name of proxy server instead of web extension server. And it’s possible that web extension server cannot connect to the proxy server. Then the picture cannot be generated by that url. So this solution also doesn’t work.
     174'''{{{127.0.0.1}}}''' is the right solution considering above cases.
     175But after IPv6 has been introduced, the solution of '''{{{127.0.0.1}}}''' will not work with IPv6.
     176The solution is: don’t use the Http API to generate the map image. Use Web Tier API instead. The API should be one of the
     177{{{
     178MgRenderingService::RenderMap(...)
     179}}}
     180The problem for the '''{{{MgRenderingService::RenderMap}}}''' API is: there is no way to set the DPI (In Http API, the DPI could be set by the '''{{{SETDISPLAYDPI}}}''' url parameter). So there is one new Web Tier API should be exposed:
     181{{{
     182void MgMapBase::SetDisplayDpi(INT32 dpi)
     183}}}
     184
     185
    148186== Implications ==
    149187Since it just makes MGOS work with IPv6, it doesn't change any existing functions.
     
    151189
    152190== Test Plan ==
    153 Since it doesn't change any existing functions, so no new test cases need be added. 
     191Unit test needs be created for the new WebTier API: '''{{{void MgMapBase::SetDisplayDpi(INT32 dpi)}}}'''
    154192
    155193