[OpenLayers-Users] Vector layer with ArcXML

David Zwarg dzwarg+ol_users at avencia.com
Tue Sep 15 10:58:03 EDT 2009


Greetings,

Yes, it is possible to do this. After you create the ArcIMS layer, set up
the mouse click event to call something like:

function mapclick( e ){
    layer.getFeatureInfo( openlayers_map.getLonLatFromPixel( e.xy ),
layer.options.layers[0],
      {
        callback: clickresult,
        scope: window
      }
    );
  }
};

function clickresult(features){
    if ( features !== null ) {
        vector.addFeatures( features.feature );
    }
};

Where "layer" is your arcims layer, "layer.options.layers[0]" is a layer
definition ArcXML needs a layer to query.  In the callback, "features" is an
object that corresponds to the ArcXML "FEATURES" element, and "vector" is
your vector layer where you want your features.  There is no need to
manually parse the response, it is handled before the getFeatureInfo
callback is invoked.

Just to let you know, there is a 1 map unit buffer by default.  This may not
be desireable, especially if you are working in EPSG:4326 (a 1 degree buffer
may be massively huge).

Zwarg

On Tue, Sep 15, 2009 at 6:20 AM, Jbaklouti <
jean-sebastien.baklouti at atosorigin.com> wrote:

>
> Hello,
>
> i see your implementation of arcxml format and arcims layer, that work's
> very well.
> I would like to know if that is possible to display vector layer from
> arcxml.
> It will work like wfs:
>           - do arcxml request's (getfeature)
>           - parse xml response
>           - display vector from parsing.
> Are there an easy way to do it?
>
> Best regards
>
> --
> View this message in context:
> http://n2.nabble.com/Vector-layer-with-ArcXML-tp3648072p3648072.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090915/6ca8029e/attachment.html


More information about the Users mailing list