Ticket #3221 (closed defect: worksforme)

Opened 3 years ago

Last modified 2 years ago

map.drawQuery() - Access Violation Exception. Inline layer.

Reported by: stepit Owned by: tamas
Priority: normal Milestone: 5.6.1 release
Component: MapScript-C# Version: svn-trunk (development)
Severity: normal Keywords: drawQuery Exception
Cc:

Description

Add the New Inline Layer:

  layerObj layer = new layerObj(map);
  layer.type = MS_LAYER_TYPE.MS_LAYER_POLYGON;
  layer.status = mapscript.MS_ON;
  layer.connectiontype = MS_CONNECTION_TYPE.MS_INLINE;

Define the attribute names from the inline layer

  layer.addProcessing("ITEMS=NAME,COLOR,INDEX");
      .....
   classObj classobj = new classObj(layer);
   classobj.template = "query";   // making the layer queryable 

Query By Attributes

   if (layer.queryByAttributes(map, FieldName, ObjName.Trim(),
 mapscript.MS_MULTIPLE) == (int)MS_RETURN_VALUE.MS_SUCCESS)
   {
     // numresults > 0
     results.numresults > 0 
     .....
   }
 Draw Query
 map.drawQuery() ==>>> Access Violation Exception !!!!!!!!!!!!!!!!!!!

Query By Point

 if (layer.queryByPoint(MyMap.Map, point, mapscript.MS_SINGLE,
     tolerance) == (int)MS_RETURN_VALUE.MS_SUCCESS)
    {
       resultCacheObj result = layer.getResults();
       if (result.numresults > 0)
       {
        ......
       }

    //Draw Query
    map.drawQuery() ==>>> Access Violation Exception too !!!!!!!!
    }

if layer is shapefile (*.shp) then map.drawQuery() - OK!

Sorry for my English.

Change History

Changed 3 years ago by tamas

I couldn't reproduce this issue, it may depend on how the features are added to the map. You can use the inline example for testing ( http://trac.osgeo.org/mapserver/browser/trunk/mapserver/mapscript/csharp/examples/inline.cs) by replacing map.draw() with map.drawQuery() and use the following command:

inline aggpng24 sample.png

Could you provide a more complete code sample to reproduce this?

Changed 2 years ago by tamas

  • status changed from new to closed
  • resolution set to worksforme

Closing the ticket, no feedback has received.

Note: See TracTickets for help on using tickets.