[mapguide-users] Converting SRS on the fly

Robert Bray rbray at robertbray.net
Sat Mar 3 02:23:31 EST 2007


Jim,

The sample was originally designed so that all markup is stored in LL84. 
Have a look in markupeditor.php and you'll find all of the AddXXX 
methods all have a line of code like:

$point = $point->Transform($this->GetTransform());

This is what is transforming the coordinates from BC Albers to LL. I did 
not look to closely but I think you can safely remove those lines in 
addition to the changes you describe below.

Bob

Jim O'Leary wrote:
> I am using the GT markup sample but I am saving a new layer in LL84 on a map
> that is in BC Albers. There must be some conversion happening on the fly,
> because the markup on the map shows up. 
> 
> However, when I extract the geometries to a pop up window, they are in
> lat/lon. This window make links that zoom to the coordinates, but this
> doesn't work as the coordinates for lat/lon are different than BC Albers.
> 
> I have tried changing the following line in the GT sample:
> 
> $sdfParams = new MgCreateSdfParams('LL84', MarkupManager::LL84WKT,
> $markupSchema);
> 
> to these two lines
> $WKT =  $map->GetMapSRS();
> $sdfParams = new MgCreateSdfParams('BC_Albers', $WKT, $markupSchema);
> 
> However, it still saves in lat / lon.
> 
> Is there a way to do this conversion on the fly, that is, programmatically?
> The application does it somehow. Alternatively, how would I save the new
> layer as BC Albers?
> 
> Thanks
> 


More information about the mapguide-users mailing list