[mapguide-users] Converting SRS on the fly
Jim O'Leary
joleary.public at gmail.com
Sun Mar 4 01:08:20 EST 2007
Yes, this works nicely. You must create the layer and save the markup both as
BC Albers, and then the markup shows up on the map.
And when I want to publish to Google Earth, I can use the code in
MarkupEditor::GetTransform() to transform the geometries in the map from BC
Albers into LL84.
Thanks.
Robert Bray-2 wrote:
>
> 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
>>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
>
--
View this message in context: http://www.nabble.com/Converting-SRS-on-the-fly-tf3337217s16610.html#a9293276
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list