[mapguide-users] Fusion API, how to add new vector layer (OpenLayers)

Dave Brett dbrett at digitalglobe.com
Mon Sep 8 18:28:35 EDT 2008


I need to perform a similar task using WMS instead of vector data.  I have
seen in other posts that the functionality has not been implemented due to
time constraints, is there a "work around" available to create a WMS layer
using the OpenLayers API?

I have tried to the steps outlined below with slight mods to be a WMS in
layer, however I still got an udefined object when I try to get the olMap. 
After digging thru the js files I found what I assume to be the OpenLayers
map object oMapOL but still no luck.

any suggestions would be greatly appreciated.

I have both MGOS and MGE2009 available for implementation.

thanks,
dave


Paul Spencer-5 wrote:
> 
> I would like to expose the OpenLayers API directly in Fusion but that  
> isn't done yet.  You can get to the OpenLayers Map object by doing  
> something like:
> 
> //'Map' is the HTML container for the map, set in MapWidget tag of  
> ApplicationDefinition
> var fusionMapWidget = Fusion.getWidgetById('Map');
> var olMap = fusionMapWidget.olMap;
> 
> Then you can do whatever you want with olMap.  Note that the  
> OpenLayers included with MapGuide Fusion may not be a full build of  
> OpenLayers so stuff like Vector might be missing - you may be able to  
> replace Fusion's OpenLayers.js with one that you build yourself.
> 
> Cheers
> 
> Paul
> 
> On 27-Mar-08, at 5:14 AM, Kenneth, GEOGRAF A/S wrote:
>> If you use OpenLayers from scratch, you will need a version with  
>> MapGuide support.
>> I'm not sure if the 2.5 release has that, but the SVN trunk has.
>>
>> To add a vector layer you can do:
>> var map = new OpenLayers.Map(...);
>> var mgLayer = new OpenLayers.Layer.MapGuide(...);
>> var vectorLayer = new OpenLayers.Layer.Vector(...);
>> map.addLayer(mglayer);
>> map.addLayer(vectorLayer);
>>
>> You will need to check up on the OpenLayers API for data to put in  
>> the ... places.
>>
>> The same should work in Fusion, you just have to find the name of  
>> the map variable.
>>
>> Regards, Kenneth, GEOGRAF A/S
>>
>>
>> Бородаев Павел Владимирович skrev:
>>>
>>> Hi All.
>>> Is it possible to add new vector layer or other layers to web map  
>>> using OpenLayers API?
>>> What modifications of source code I should do and where? This will  
>>> be very useful for me: if it is impossible I will use OpenLayers  
>>> from scratch.
>>> TIA.
>>> _______________________________________________
>>> mapguide-users mailing list
>>> mapguide-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>>
>> _______________________________________________
>> mapguide-users mailing list
>> mapguide-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> 
> _______________________________________________
> 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/Fusion-API%2C-how-to-add-new-vector-layer-%28OpenLayers%29-tp16324806p19382559.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list