ThinkGeo.com    |     Blog    |     Wiki    |     Support

Problem drawing features with GeoTextureBrush

Hi,



I am trying to draw features on map with custom image using GeoTextureBrush.

Created custom style with DrawCore overwritten.

Seems GeoImage doesn’t load images either from Silverlight relative path or from full image resource HTTP URL (in this case Fiddler never showed the request to the HTTP URL). 



Here is the code of DrawCore:



        protected override void DrawCore( IEnumerable<Feature> features, GeoCanvas canvas, Collection<SimpleCandidate> labelsInThisLayer, Collection<SimpleCandidate> labelsInAllLayers )
        {
            // Loop through all of the features being passed in to draw.
            foreach( var feature in features )
            {
                try
                {
                    string textureUri;
                    if( feature.ColumnValues.TryGetValue( “TextureUri”, out textureUri ) )
                    {
                            var geoImage = new GeoImage( new Uri( textureUri ) );





                            var geoTextureBrush = new GeoTextureBrush( geoImage, GeoWrapMode.Tile );
                            var shapeWellKnownType = feature.GetWellKnownType();
                            if( shapeWellKnownType == WellKnownType.Polygon )
                            {
                                var polygonShape = new PolygonShape( feature.GetWellKnownBinary() );
                                canvas.DrawArea( polygonShape, geoTextureBrush, DrawingLevel.LevelOne );
                            }


                            else if( shapeWellKnownType == WellKnownType.Multipolygon )
                            {
                                var multiPolygonShape = new MultipolygonShape( feature.GetWellKnownBinary() );
                                canvas.DrawArea( multiPolygonShape, geoTextureBrush, DrawingLevel.LevelOne );
                            }


                        }
                    }
                }
                catch { }
            }
        }
Is there any other solution I can use to show custom texture image on feature?



Thanks





Hi Rustam, 
  
 Please try using “GeoImageBrush” instead of “GeoTextureBrush”. 
  
 Any questions please let me know. 
  
 Thanks, 
 Peter 


Hi Peter,



Thanks for your answer.

GeoImageBrush doesn’t support image tiling, therefore I cannot replace GeoTextureBrush with GeoImageBrush.


Hi Rustam,


The Silverlight Edition doesn’t support GeoTextureBrush at this
time. But it can be voted as a new feature at here or you can
contact the sales to see whether it can be implemented via  professional service.


Thanks,

Peter