examples/Shapefiles.js
function (attributes, record) {
            var configuration = {};
            configuration.name = attributes.values.name || attributes.values.Name || attributes.values.NAME;

            if (record.isPointType()) { // Configure point-based features (cities, in this example)
                configuration.name = attributes.values.name || attributes.values.Name || attributes.values.NAME;

                configuration.attributes = new WorldWind.PlacemarkAttributes(placemarkAttributes);

                if (attributes.values.pop_max) {
                    var population = attributes.values.pop_max;
                    configuration.attributes.imageScale = 0.01 * Math.log(population);
                }
            } else if (record.isPolygonType()) { // Configure polygon-based features (countries, in this example).
                configuration.attributes = new WorldWind.ShapeAttributes(null);

                // Fill the polygon with a random pastel color.
                configuration.attributes.interiorColor = new WorldWind.Color(
                    0.375 + 0.5 * Math.random(),
                    0.375 + 0.5 * Math.random(),
                    0.375 + 0.5 * Math.random(),
                    1.0);

                // Paint the outline in a darker variant of the interior color.
                configuration.attributes.outlineColor = new WorldWind.Color(
                    0.5 * configuration.attributes.interiorColor.red,
                    0.5 * configuration.attributes.interiorColor.green,
                    0.5 * configuration.attributes.interiorColor.blue,
                    1.0);
            }

            return configuration;
        }
function (attributes, record) {
            var configuration = {};
            configuration.name = attributes.values.name || attributes.values.Name || attributes.values.NAME;

            if (record.isPointType()) { // Configure point-based features (cities, in this example)
                configuration.name = attributes.values.name || attributes.values.Name || attributes.values.NAME;

                configuration.attributes = new WorldWind.PlacemarkAttributes(placemarkAttributes);

                if (attributes.values.pop_max) {
                    var population = attributes.values.pop_max;
                    configuration.attributes.imageScale = 0.01 * Math.log(population);
                }
            } else if (record.isPolygonType()) { // Configure polygon-based features (countries, in this example).
                configuration.attributes = new WorldWind.ShapeAttributes(null);

                // Fill the polygon with a random pastel color.
                configuration.attributes.interiorColor = new WorldWind.Color(
                    0.375 + 0.5 * Math.random(),
                    0.375 + 0.5 * Math.random(),
                    0.375 + 0.5 * Math.random(),
                    1.0);

                // Paint the outline in a darker variant of the interior color.
                configuration.attributes.outlineColor = new WorldWind.Color(
                    0.5 * configuration.attributes.interiorColor.red,
                    0.5 * configuration.attributes.interiorColor.green,
                    0.5 * configuration.attributes.interiorColor.blue,
                    1.0);
            }

            return configuration;
        }
function ( attributes , record ) { var configuration = { } ; configuration . name = attributes . values . name || attributes . values . Name || attributes . values . NAME ; if ( record . isPointType ( ) ) { // Configure point-based features (cities, in this example) configuration . name = attributes . values . name || attributes . values . Name || attributes . values . NAME ; configuration . attributes = new WorldWind . PlacemarkAttributes ( placemarkAttributes ) ; if ( attributes . values . pop_max ) { var population = attributes . values . pop_max ; configuration . attributes . imageScale = 0.01 * Math . log ( population ) ; } } else if ( record . isPolygonType ( ) ) { // Configure polygon-based features (countries, in this example). configuration . attributes = new WorldWind . ShapeAttributes ( null ) ; // Fill the polygon with a random pastel color. configuration . attributes . interiorColor = new WorldWind . Color ( 0.375 + 0.5 * Math . random ( ) , 0.375 + 0.5 * Math . random ( ) , 0.375 + 0.5 * Math . random ( ) , 1.0 ) ; // Paint the outline in a darker variant of the interior color. configuration . attributes . outlineColor = new WorldWind . Color ( 0.5 * configuration . attributes . interiorColor . red , 0.5 * configuration . attributes . interiorColor . green , 0.5 * configuration . attributes . interiorColor . blue , 1.0 ) ; } return configuration ; }
Callback function for configuring shapefile visualization.
Callback function for configuring shapefile visualization .