ThinkGeo.com    |     Documentation    |     Premium Support

Isoline-Line-Feature with colored areas

Hi all,

i just experimented with the isoline-demo from the samples.

In the screenshot of the sample the area between the isolines is colored (like in a heatmap). Running the sample-code i only get the isolines colored, but the area between the lines is not filled. What kind of style do i have to use to get the areas as in the sample-screenshot.

Any help is appreciated.

Best regards,
Andreas

Follow-Up:

is it possible to get the source-code for the sample’s here http://samples.thinkgeo.com/WebApiEdition/SampleTemplates/visualization/leaflet/#

They do exactly what i want to accomplish.

Regards,
Andreas

Hi Andreas,

You can open our product center and find the samples under Map Suite WebAPI Edition.

And I guess this maybe the sample code which you want: http://wiki.thinkgeo.com/wiki/Source_Code_WebAPIEditionSample_Visualization.zip

Regards,

Don

Hi Don,

i downloaded the WebAPI demos and integrated the methods from OverLayBuilder into my sample-app.

But the code throws an error without giving a hint what is wrong:

        wpfMap1.MapUnit = GeographyUnit.DecimalDegree;
        AddDynamicIsolineLayer();

    private void AddDynamicIsolineLayer()
    {
        LayerOverlay lo = OverlayBuilder.GetOverlayWithIsoLineStyle();
        wpfMap1.Overlays.Add(lo);
        wpfMap1.Refresh();
    }

The methods from OverlayBuilder are taken as is from the WebAPI demo.

The exception thrown is

System.ArgumentException was unhandled
Message: An unhandled exception of type ‘System.ArgumentException’ occurred in WpfDesktopEdition.dll
Additional information: Ein Element mit dem gleichen Schlüssel wurde bereits hinzugefügt. ( An element wth the same key was already added)

Regards,
Andreas

Followup:
I found the error. In the method

    private static IEnumerable<double> GetClassBreakValues(IEnumerable<double> values, int count)
    {
        // Take an average value for creating class breaks.  
        Collection<double> result = new Collection<double>();
        double[] sortedValues = values.OrderBy(v => v).ToArray();
        int classCount = sortedValues.Length / count;
        for (int i = 1; i < count; i++)
        {
            result.Add(sortedValues[i * classCount]);
        }

        return result;
    }

There was a pipe-character in

            result.Add(sortedValues[i  | *classCount]);

Now the demo runs, but doesn’t show any Overlay.

Regards,
Andreas

Hi Andreas,

Are you viewing this sample?

And please make sure your dll have been updated to the latest version, then update the reference in project.

Regards,

Don

I found the error. There is a file with well-data which is read. This file contains data separated by commas, having points as decimal-char. I’m in germany and here a point is interpreted as a grouping-char. Hence, all geometry-data is wrong as the decimal-point is interpreted wrongly (instead of e.g. 100.234 the value is converted to 100234). I’ve changed the reading-process to use german-language-settings, then the example works.

Maybe you shpuld have a look at the samples and them language-independent.

Regards,
Andreas

Hi Andreas,

Thanks for your report. we will report this issue to our developer team. They will refine this issue in GitHub sample.

Thanks again for this.

Thanks,
Bill