ThinkGeo.com    |     Documentation    |     Premium Support

How can I show NoaaWeatherStationFeatureLayer on a BingMapsOverlay?

I am able to get the sample code working using WorlMapKitWmsWebOverlay but not with BingMapsOverlay. Has anyone been able to make this work?

Here is my code:

        map1.MapUnit = GeographyUnit.Meter;
        Proj4Projection proj4 = new Proj4Projection();
        proj4.InternalProjectionParametersString = Proj4Projection.GetEsriParametersString(4326); //Geodetic (decimal degrees).  
        proj4.ExternalProjectionParametersString = Proj4Projection.GetBingMapParametersString(); // Google Map projection (Spherical Mercator)  

        //Gets the RectangleShape in the Google Map projection.  
        proj4.Open();
        RectangleShape bingMapRectangleShape = proj4.ConvertToExternalProjection(new RectangleShape(-130.5615234375, 63.193359375, -44.0771484375, 11.337890625));
        proj4.Close();

        AddBingOverlay(BingMapsStyle.Hybrid);

        //map1.MapUnit = GeographyUnit.DecimalDegree;
        //map1.CustomOverlays.Add(new WorldMapKitWmsWebOverlay());

        //Add NoaaWeatherStationFeatureLayer to LayerOverlay.  
        LayerOverlay noaaWeatherStationOverlay = new LayerOverlay();
        map1.CustomOverlays.Add(noaaWeatherStationOverlay);

        NoaaWeatherStationFeatureLayer noaaWeatherStationFeatureLayer = new NoaaWeatherStationFeatureLayer();
        noaaWeatherStationFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(new NoaaWeatherStationStyle());
        noaaWeatherStationFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
        noaaWeatherStationOverlay.Layers.Add(noaaWeatherStationFeatureLayer);

        //move map to usa.  
        map1.CurrentExtent = bingMapRectangleShape;

Hi Randy,

Please try to set your proj4 to noaaWeatherStationFeatureLayer.FeatureSource.Projection and see whether it works?

And whether your WorldMapKitWmsWebOverlay works for 4326?

Regards,

Don

Thanks Don. I stumbled upon setting FeatureSource.Projection to proj4 myself and it does work. The line with WorldMapKitWmsWebOverlay is commented out. Now to get a weather radar overlay working. Do you know where I can find any working examples?

Hi Randy,

You can try to find our sample from “Project Templates” and “Code Samples” from our product center, and you can also find them from wiki here: http://wiki.thinkgeo.com/wiki/map_suite_web_edition_all_samples

Do you think the sample “Filter Radar Image” is helpful?

Regards,

Don