[fusion-users] Fusion + MapServer Function/Look Like MapGuide
Mike Adair
madair at dmsolutions.ca
Wed Jul 16 09:28:50 EDT 2008
I'm starting to work on this again, so like Paul says, feedback would be
very helpful. What I have so far, is that the ApplicationDefinition
would define multiple Map elements in the MapGroup element like so:
<MapGroup id="multimap" xsi:type="MapType">
<Map xsi:type="MapGuideLayerType">
<Type>MapGuide</Type>
<SingleTile>true</SingleTile>
<Extension>
<ResourceId>Library://Samples/Sheboygan/Maps/Sheboygan1.MapDefinition</ResourceId>
</Extension>
</Map>
<Map xsi:type="MapGuideLayerType">
<Type>MapServer</Type>
<SingleTile>true</SingleTile>
<Extension>
<MapFile>/ms4w/apps/gmap/htdocs/gmap75.map</MapFile>
</Extension>
</Map>
</MapGroup>
and the first one would become the baseLayer, the Type element would (in
theory) accept any OpenLayers.Layer.* type and there would be a 1:1
mapping of OL layer properties in the <Extension> element. There remains
some questions around the establishing a session and the LoadMap.php
call for the various layer types and how to make it work for vector layers.
I'll be setting up a sandbox for this work today.
Mike
Paul Spencer wrote:
> It should be possible :) You will need to spend some quality time
> with firebug probably, but in essence you can get access to the
> OpenLayers.Map instance and then do whatever you want. I would
> probably approach it like this:
>
> window.onload=function(){
> Fusion.registerForEvent(Fusion.Event.FUSION_INITIALIZED,
> fusionInitialized);
> Fusion.registerForEvent(Fusion.Event.FUSION_ERROR, fusionError);
> Fusion.initialize();
> }
>
> function fusionError(eventId, error) {
> console.log('Fusion Error: '+error.toString();
> }
>
> function fusionInitialized(eventId) {
> var map = Fusion.getWidgetById('Map'); // the id of the div
> containing the map
> var olMap = map.oMapOL;
> var wms = new OpenLayers.Layer.WMS(/* parameters */);
> olMap.addLayer(wms);
> }
>
> You will probably run into difficulty with the whole baseLayer thing
> in OpenLayers. By default, most tile-based layers want to be base
> layers and you need to add isBaseLayer: false to the layer options
> (4th arg to WMS layer, might be different in other layer types).
>
> You can also start Fusion without a map loaded and inject a baseLayer
> using this method, but then a whole bunch of things won't really work
> - for instance a lot of widgets only get enabled after a map has loaded.
>
> Some feedback on *how* this should work would be appreciated. If you
> have a particular use case and would like to be able to set things up
> in a particular way, that would be very useful to the developers as we
> plan out exposing more OpenLayers stuff.
>
> Cheers
>
> Paul
>
> On 16-Jul-08, at 1:42 AM, David Percy wrote:
>
>> Paul, thanks for the explanation on the tiling.
>>
>> I've actually been waiting to use and contribute to Fusion until the
>> tiling was in place, as we currently use kamap for our tiling engine
>> for the US geological survey, and it really helps. We are just
>> working with Mootools and Openlayers, but I'd be happier if we were
>> contributing to an active project, like Fusion, since that's the open
>> source spirit.
>>
>> Is there a way to "wire" the unsupported Openlayers layer types into
>> a Fusion app? It doesn't seem like it should be too difficult, but I
>> was worried about making things hard to migrate once the Fusion
>> framework supports it.
>>
>> I'd appreciate any thoughts you (or others on the PSC) have on this.
>> Cheers,
>> Percy
>>
>> Paul Spencer wrote:
>>> Hi Tim,
>>> you can get a Fusion application to look essentially like that
>>> application using mapserver. The tiling capability on the client
>>> side is implemented by OpenLayers, so there is nothing magically
>>> mapguide about it. However, there is no support in the
>>> ApplicationDefinition to let you define a tiled mapserver layer. We
>>> are working on supporting all the OpenLayers layer types through the
>>> ApplicationDefinition for the 1.1 release but this work has not yet
>>> been done.
>>> Even when the necessary hooks in Fusion are available, you will
>>> still need something on the server side to generate the tiles. You
>>> can use mapserver to do this directly, but it is pretty inefficient
>>> since mapserver will draw the same tile over and over again. What
>>> you need is something that will cache tiles for you and serve them
>>> from the cache if available. For this, we will be recommending
>>> either the kaMap's tile.php or TileCache.
>>> Cheers
>>> Paul
>>> On 14-Jul-08, at 4:22 PM, Nolte, Tim wrote:
>>>> OK, I know this is probably wishful thinking. AS I've looked at the
>>>> MapGuide live app gallery. And specifically the following demo:
>>>>
>>>>
>>>> http://data.mapguide.com/mapguide/phpviewersample/ajaxviewersample.php
>>>>
>>>> I would like to get Fusion (1.0.6) functioning and looking like that
>>>> demo but using UMN MapServer. Is this even possible? Something I'm
>>>> also
>>>> wondering about is the Tiled AJAX sample. Is the tiling something
>>>> specific and built in to MapGuide? I'm assuming the tiling is
>>>> something
>>>> on the server side and nothing to do with Fusion?
>>>>
>>>> - Tim
>>>>
>>>> ----
>>>> Timothy J Nolte - tnolte at ilpcs.com
>>>> Network Planning Engineer
>>>>
>>>> iPCS Wireless, Inc.
>>>> 4717 Broadmoor Ave, Suite G
>>>> Kentwood, MI 49512
>>>>
>>>> Office: 616-656-5163
>>>> PCS: 616-706-2438
>>>> Fax: 616-554-6484
>>>> Web: www.ipcswirelessinc.com
>>>> _______________________________________________
>>>> fusion-users mailing list
>>>> fusion-users at lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/fusion-users
>>> __________________________________________
>>> Paul Spencer
>>> Chief Technology Officer
>>> DM Solutions Group Inc
>>> http://www.dmsolutions.ca/
>>> _______________________________________________
>>> fusion-users mailing list
>>> fusion-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/fusion-users
>>
>> --
>> David Percy
>> Geospatial Data Manager
>> Geology Department
>> Portland State University
>> http://gisgeek.pdx.edu
>> 503-725-3373
>
>
> __________________________________________
>
> Paul Spencer
> Chief Technology Officer
> DM Solutions Group Inc
> http://www.dmsolutions.ca/
>
> _______________________________________________
> fusion-users mailing list
> fusion-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fusion-users
>
More information about the fusion-users
mailing list