diff --git a/samples/dds-region-viewer/README.md b/samples/dds-region-viewer/README.md new file mode 100644 index 00000000..4675fed5 --- /dev/null +++ b/samples/dds-region-viewer/README.md @@ -0,0 +1,63 @@ +# Google Maps JavaScript Sample + +The Region Viewer lets you view all types of boundaries for every supported region. +It is intended as a utility rather than a direct code demonstration. + +## Run the conversion scripts + +The Region Viewer relies on Google-provided JSON coverage data files to populate +its menus. The Coverage data is periodically updated. Authors can generate new +coverage data from CSV files using the Python scripts located in `/scripts`. + +The conversion scripts have specific sorting requirements for the input CSV files: + +- `csv_to_html.py` requires the CSV to be sorted by the "Country Code" column. Used +to generate the HTML table for the documentation page. +- `csv_to_json.py` requires the CSV to be sorted by the "Country Name En" column. +Used to generate JSON data for menu logic. + +To update coverage data: + +1. Update the CSV files with ones containing the latest data. +2. From the `samples/dds-region-viewer/` folder, run the following commands: + + ```bash + python3 scripts/csv_to_html.py + python3 scripts/csv_to_json.py + ``` + +## Setup + +### Before starting run: + +`npm i` + +### Run an example on a local web server + +`cd samples/dds-region-viewer` +`npm start` + +### Build an individual example + +`cd samples/dds-region-viewer` +`npm run build` + +From 'samples': + +`npm run build --workspace=dds-region-viewer/` + +### Build all of the examples. + +From 'samples': + +`npm run build-all` + +### Run lint to check for problems + +`cd samples/dds-region-viewer` +`npx eslint index.ts` + +## Feedback + +For feedback related to this sample, please open a new issue on +[GitHub](https://github.com/googlemaps-samples/js-api-samples/issues). diff --git a/samples/dds-region-viewer/index.html b/samples/dds-region-viewer/index.html new file mode 100644 index 00000000..8f9effd9 --- /dev/null +++ b/samples/dds-region-viewer/index.html @@ -0,0 +1,90 @@ + + + + + + Region Coverage Viewer + + + + + + + + +
+ +
+
+ + + diff --git a/samples/dds-region-viewer/index.ts b/samples/dds-region-viewer/index.ts new file mode 100644 index 00000000..a403aa27 --- /dev/null +++ b/samples/dds-region-viewer/index.ts @@ -0,0 +1,455 @@ +/** + * @license + * Copyright 2025 Google LLC. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * Data-driven styling region coverage viewer! + * - View feature boundary availability around the world. + * - Set color for fill and stroke of feature polygons. + */ + +// [START maps_dds_region_viewer] +const mapElement = document.querySelector('gmp-map') as google.maps.MapElement; +let placeAutocomplete; +let innerMap; +let countryMenu: HTMLSelectElement; +let featureMenu: HTMLSelectElement; +let searchInputOption: HTMLInputElement; +let fillColorPicker: HTMLInputElement; +let strokeColorPicker: HTMLInputElement; +let contentDiv: HTMLElement; + +let allLayers; +let countryLayer; +let admin1Layer; +let admin2Layer; +let localityLayer; +let postalCodeLayer; +let schoolDistrictLayer; + +let selectedPlaceId: string; + +import * as countries from './src/countries.json'; + +async function initMap() { + (await google.maps.importLibrary('maps')) as google.maps.MapsLibrary; + (await google.maps.importLibrary('places')) as google.maps.PlacesLibrary; + (await google.maps.importLibrary('marker')) as google.maps.MarkerLibrary; + + // Get the inner map. + innerMap = mapElement.innerMap; + innerMap.setOptions({ + mapTypeControl: false, + }); + + // Create the Place Autocomplete widget. + placeAutocomplete = document.querySelector( + 'gmp-place-autocomplete' + ) as google.maps.places.PlaceAutocompleteElement; + placeAutocomplete.includedPrimaryTypes = ['(regions)']; + + contentDiv = document.getElementById('pac-content') as HTMLElement; + searchInputOption = document.getElementById( + 'pac-filter-option' + ) as HTMLInputElement; + countryMenu = document.getElementById( + 'country-select' + ) as HTMLSelectElement; + featureMenu = document.getElementById( + 'feature-type-select' + ) as HTMLSelectElement; + fillColorPicker = document.getElementById( + 'fill-color-picker' + ) as HTMLInputElement; + strokeColorPicker = document.getElementById( + 'stroke-color-picker' + ) as HTMLInputElement; + + // Set up input events. + countryMenu.addEventListener('change', onCountrySelected); + featureMenu.addEventListener('change', featureTypeChanged); + fillColorPicker.addEventListener('change', styleChanged); + strokeColorPicker.addEventListener('change', styleChanged); + + searchInputOption.addEventListener('change', () => { + if (searchInputOption.checked) { + // Do not show school_district since AC cannot use it for filtering. + featureMenu.item(5)!.disabled = true; + setFeatureType(); + } else { + // Show school districts. + featureMenu.item(5)!.disabled = false; + setFeatureType(); + } + }); + + // Handle autocomplete widget selection. + placeAutocomplete.addEventListener( + 'gmp-select', + async ({ placePrediction }) => { + const types = placePrediction.types as string[]; + + // Find the first type that matches a feature menu option. + const validFeatureTypes = [ + 'country', + 'administrative_area_level_1', + 'administrative_area_level_2', + 'locality', + 'postal_code', + 'school_district', + ]; + for (const type of types) { + if (validFeatureTypes.includes(type)) { + featureMenu.value = type; // Set the menu value directly + break; // Use the first matching type found + } + } + setFeatureType(); // Update autocomplete filtering based on new menu selection + showSelectedPolygon(placePrediction.placeId, 1); + } + ); + + // Add all the feature layers. + countryLayer = innerMap.getFeatureLayer('COUNTRY'); + admin1Layer = innerMap.getFeatureLayer('ADMINISTRATIVE_AREA_LEVEL_1'); + admin2Layer = innerMap.getFeatureLayer('ADMINISTRATIVE_AREA_LEVEL_2'); + localityLayer = innerMap.getFeatureLayer('LOCALITY'); + postalCodeLayer = innerMap.getFeatureLayer('POSTAL_CODE'); + schoolDistrictLayer = innerMap.getFeatureLayer('SCHOOL_DISTRICT'); + + // Add event listeners for feature layers. + countryLayer.addListener('click', handlePlaceClick); + admin1Layer.addListener('click', handlePlaceClick); + admin2Layer.addListener('click', handlePlaceClick); + localityLayer.addListener('click', handlePlaceClick); + postalCodeLayer.addListener('click', handlePlaceClick); + schoolDistrictLayer.addListener('click', handlePlaceClick); + + // List of all the layers when they get initialized. + allLayers = [ + countryLayer, + admin1Layer, + admin2Layer, + localityLayer, + postalCodeLayer, + schoolDistrictLayer, + ]; + + // Init map styles. + applyStyle(); + + // Set up country and feature menus. + buildMenu(); + onCountrySelected(); + featureMenu.selectedIndex = 0; // Set to COUNTRY. +} + +// Restyle and make a request when the feature type is changed. +function featureTypeChanged() { + // Style for coloring the outline of the entire feature type. + let styleStrokeOnly = /** @type {!google.maps.FeatureStyleOptions} */ { + fillColor: 'white', + fillOpacity: 0.01, + strokeColor: strokeColorPicker.value, + strokeOpacity: 1.0, + strokeWeight: 2.0, + }; + + revertStyles(); + setFeatureType(); + selectedPlaceId = ''; + contentDiv.innerHTML = ''; + + // Apply the style to the selected feature layer. + switch (featureMenu.value) { + case 'country': + countryLayer.style = styleStrokeOnly; + searchInputOption.disabled = false; + break; + case 'administrative_area_level_1': + admin1Layer.style = styleStrokeOnly; + searchInputOption.disabled = false; + break; + case 'administrative_area_level_2': + admin2Layer.style = styleStrokeOnly; + searchInputOption.disabled = false; + break; + case 'locality': + localityLayer.style = styleStrokeOnly; + searchInputOption.disabled = false; + break; + case 'postal_code': + postalCodeLayer.style = styleStrokeOnly; + searchInputOption.disabled = false; + break; + case 'school_district': + schoolDistrictLayer.style = styleStrokeOnly; + searchInputOption.disabled = true; + break; + default: + break; + } +} + +// Toggle autocomplete types based on restrict search checkbox. +function setFeatureType() { + if (searchInputOption.checked) { + // Set autocomplete to the selected type. + placeAutocomplete.includedPrimaryTypes = [featureMenu.value]; + } else { + // Set autocomplete to return all feature types. + placeAutocomplete.includedPrimaryTypes = ['(regions)']; + } +} + +// Restyle when the stroke or fill is changed. +function styleChanged() { + if (selectedPlaceId) { + applyStyle(selectedPlaceId); + } +} + +// Apply styling to a polygon. +function applyStyle(placeid?) { + // Define styles. + let styleStrokeOnly = /** @type {!google.maps.FeatureStyleOptions} */ { + strokeColor: strokeColorPicker.value, + strokeOpacity: 1.0, + strokeWeight: 2.0, + fillColor: 'white', + fillOpacity: 0.1, + }; + + let styleStrokeFill = /** @type {!google.maps.FeatureStyleOptions} */ { + strokeColor: strokeColorPicker.value, + strokeOpacity: 1.0, + strokeWeight: 2.0, + fillColor: fillColorPicker.value, + fillOpacity: 0.5, + }; + + revertStyles(); + + const featureStyle = (params) => { + if (params.feature.placeId == placeid) { + return styleStrokeFill; + } else { + return styleStrokeOnly; + } + }; + + // Only style the selected feature type. + switch (featureMenu.value) { + case 'country': + countryLayer.style = featureStyle; + searchInputOption.disabled = false; + break; + case 'administrative_area_level_1': + admin1Layer.style = featureStyle; + searchInputOption.disabled = false; + break; + case 'administrative_area_level_2': + admin2Layer.style = featureStyle; + searchInputOption.disabled = false; + break; + case 'locality': + localityLayer.style = featureStyle; + searchInputOption.disabled = false; + break; + case 'postal_code': + postalCodeLayer.style = featureStyle; + searchInputOption.disabled = false; + break; + case 'school_district': + schoolDistrictLayer.style = featureStyle; + searchInputOption.disabled = true; + break; + default: + break; + } +} + +// Populate the countries menu. +function buildMenu() { + for (const item of (countries as any).default) { + let countryOption = document.createElement('option'); + countryOption.textContent = item.name; + countryOption.value = item.code; + // Set U.S. as the default. + if (item.code == 'US') { + countryOption.selected = true; + } + countryMenu.appendChild(countryOption); + } +} + +// Populate the feature type menu with the supported feature types. +function onCountrySelected() { + // Get the selected value. + const selectedCountryCode = countryMenu.value; + updateFeatureMenuAvailability(selectedCountryCode); + + // Set the feature list selection to 'country'. + featureMenu.namedItem('country')!.selected = true; + + showSelectedCountry(countryMenu.options[countryMenu.selectedIndex].text); +} + +// Enables or disables items in the feature menu based on country support. +function updateFeatureMenuAvailability(countryCode: string) { + const featureAvailabilityMap = getFeatureAvailability(countryCode); + + // Do a comparison on the map, and disable any false items. + for (const [feature, isAvailable] of featureAvailabilityMap) { + const menuItem = featureMenu.namedItem(feature) as HTMLOptionElement; + if (menuItem) menuItem.disabled = !isAvailable; + } +} + +// Return a map of feature availability for a country. +function getFeatureAvailability(countryName) { + // Return the data for the selected country. + const selectedCountry = (countries as any).default.find((country) => { + return country.code === countryName; + }); + + // Create a map for our values. + let featureAvailabilityMap = new Map([ + ['country', selectedCountry?.feature.country], + [ + 'administrative_area_level_1', + selectedCountry?.feature.administrative_area_level_1, + ], + [ + 'administrative_area_level_2', + selectedCountry?.feature.administrative_area_level_2, + ], + ['postal_code', selectedCountry?.feature.postal_code], + ['locality', selectedCountry?.feature.locality], + ['school_district', selectedCountry?.feature.school_district], + ]); + + return featureAvailabilityMap; +} + +// Restyle all feature layers to be invisible. +function revertStyles() { + for (const layer of allLayers) { + layer.style = null; + } +} + +// Apply styling to the clicked place. +function handlePlaceClick(event) { + let clickedPlaceId = event.features[0].placeId; + if (!clickedPlaceId) return; + showSelectedPolygon(clickedPlaceId, 0); +} + +// Get the place ID for the selected country, then call showSelectedPolygon(). +async function showSelectedCountry(countryName) { + const { Place } = (await google.maps.importLibrary( + 'places' + )) as google.maps.PlacesLibrary; + + contentDiv.textContent = ''; + + const request = { + textQuery: countryName, + fields: ['id'], + }; + + const { places } = await Place.searchByText(request); + + if (places.length > 0) { + showSelectedPolygon(places[0].id, 0); + } +} + +// Event handler for when a polygon is selected. +// mode 0 = click, mode 1 = autocomplete. +async function showSelectedPolygon(placeid, mode) { + let isFeatureSupported; + const { Place } = (await google.maps.importLibrary( + 'places' + )) as google.maps.PlacesLibrary; + selectedPlaceId = placeid; + contentDiv.textContent = ''; // Clear the info display. + + const place = new Place({ + id: placeid, + }); + + await place.fetchFields({ + fields: [ + 'displayName', + 'formattedAddress', + 'viewport', + 'types', + 'addressComponents', + ], + }); + + // Zoom to the polygon and change the country menu selection. + const countryComponent = place.addressComponents?.find((c) => + c.types.includes('country') + ); + if (countryComponent) { + countryMenu.value = countryComponent.shortText!; + updateFeatureMenuAvailability(countryMenu.value); + + // Check if the selected feature type is supported by the new country. + isFeatureSupported = getFeatureAvailability(countryMenu.value).get( + featureMenu.value + ); + } + var viewport = place.viewport as google.maps.LatLngBounds; + innerMap.fitBounds(viewport, 155); + + // Build the HTML. + contentDiv.appendChild(document.createElement('hr')); + + const types = place.types as string[]; + + // Create HTML for place information. + const placeInfo = document.createElement('div'); + placeInfo.id = 'place-info'; + + // Show information if boundary was clicked (mode 0). + if (mode == 0) { + const boldAddress = document.createElement('b'); + boldAddress.textContent = place.formattedAddress!; + const placeIdCode = document.createElement('code'); + placeIdCode.textContent = placeid; + const featureTypeCode = document.createElement('code'); + featureTypeCode.textContent = types[0]; + + placeInfo.append(boldAddress); + placeInfo.append( + document.createElement('br'), + 'Place ID: ', + placeIdCode + ); + placeInfo.append( + document.createElement('br'), + 'Feature type: ', + featureTypeCode + ); + } else { + // Display other information if autocomplete was used (mode 1). + if (!isFeatureSupported) { + placeInfo.textContent = `Feature type (${featureMenu.value}) is not supported for this country.`; + } else { + placeInfo.textContent = `Click a boundary to see its place ID and feature type.`; + } + } + contentDiv.appendChild(placeInfo); + + // Call the global styling function. + applyStyle(placeid); +} + +initMap(); +// [END maps_dds_region_viewer] diff --git a/samples/dds-region-viewer/package.json b/samples/dds-region-viewer/package.json new file mode 100644 index 00000000..45361ba3 --- /dev/null +++ b/samples/dds-region-viewer/package.json @@ -0,0 +1,14 @@ +{ + "name": "@js-api-samples/dds-region-viewer", + "version": "1.0.0", + "scripts": { + "build": "tsc && bash ../jsfiddle.sh dds-region-viewer && bash ../app.sh dds-region-viewer && bash ../docs.sh dds-region-viewer && npm run build:vite --workspace=. && bash ../dist.sh dds-region-viewer", + "test": "tsc && npm run build:vite --workspace=.", + "start": "tsc && vite build --base './' && vite", + "build:vite": "vite build --base './'", + "preview": "vite preview" + }, + "dependencies": { + + } +} diff --git a/samples/dds-region-viewer/scripts/countries-HTML.csv b/samples/dds-region-viewer/scripts/countries-HTML.csv new file mode 100644 index 00000000..6aac3d3b --- /dev/null +++ b/samples/dds-region-viewer/scripts/countries-HTML.csv @@ -0,0 +1,251 @@ +Country Code,Country Name En,Country,Administrative Area1,Administrative Area2,Administrative Area3,Administrative Area4,Postal Code,Locality,Sublocality1,Neighborhood,School District +AD,Andorra,INCLUDE,INCLUDE,,,,INCLUDE,,,, +AE,United Arab Emirates,INCLUDE,,,,,,,,, +AF,Afghanistan,INCLUDE,INCLUDE,,,,,,,, +AG,Antigua & Barbuda,INCLUDE,INCLUDE,,,,,,,, +AI,Anguilla,INCLUDE,,,,,,,,, +AL,Albania,INCLUDE,INCLUDE,,,,,,,, +AM,Armenia,INCLUDE,INCLUDE,,,,,,,, +AO,Angola,INCLUDE,INCLUDE,INCLUDE,,,,,,, +AQ,Antarctica,INCLUDE,,,,,,,,, +AR,Argentina,INCLUDE,INCLUDE,INCLUDE,,,,,,, +AS,American Samoa,INCLUDE,INCLUDE,INCLUDE,,,,,,, +AT,Austria,INCLUDE,INCLUDE,INCLUDE,INCLUDE,,,,,, +AU,Australia,INCLUDE,INCLUDE,INCLUDE,,,,INCLUDE,,, +AW,Aruba,INCLUDE,,,,,,,,, +AX,Åland Islands,INCLUDE,INCLUDE,,,,,,,, +AZ,Azerbaijan,INCLUDE,INCLUDE,INCLUDE,,,,,,, +BA,Bosnia & Herzegovina,INCLUDE,INCLUDE,INCLUDE,,,,,,, +BB,Barbados,INCLUDE,INCLUDE,,,,,,,, +BD,Bangladesh,INCLUDE,INCLUDE,INCLUDE,,,,,,, +BE,Belgium,INCLUDE,INCLUDE,INCLUDE,INCLUDE,,INCLUDE,INCLUDE,,, +BF,Burkina Faso,INCLUDE,INCLUDE,INCLUDE,,,,,,, +BG,Bulgaria,INCLUDE,INCLUDE,INCLUDE,,,,INCLUDE,,, +BH,Bahrain,INCLUDE,INCLUDE,,,,,,,, +BI,Burundi,INCLUDE,INCLUDE,,,,,,,, +BJ,Benin,INCLUDE,INCLUDE,,,,,,,, +BL,St. Barthélemy,INCLUDE,,,,,,,,, +BM,Bermuda,INCLUDE,INCLUDE,,,,,,,, +BN,Brunei,INCLUDE,INCLUDE,,,,,,,, +BO,Bolivia,INCLUDE,INCLUDE,INCLUDE,,,,,,, +BQ,Caribbean Netherlands,INCLUDE,INCLUDE,,,,,,,, +BR,Brazil,INCLUDE,INCLUDE,INCLUDE,,INCLUDE,,,,, +BS,Bahamas,INCLUDE,INCLUDE,,,,,,,, +BT,Bhutan,INCLUDE,INCLUDE,,,,,,,, +BV,Bouvet Island,INCLUDE,,,,,,,,, +BW,Botswana,INCLUDE,INCLUDE,,,,,,,, +BY,Belarus,INCLUDE,INCLUDE,INCLUDE,,,,,,, +BZ,Belize,INCLUDE,INCLUDE,,,,,,,, +CA,Canada,INCLUDE,INCLUDE,,,,,,,, +CC,Cocos (Keeling) Islands,INCLUDE,INCLUDE,,,,INCLUDE,,,, +CD,Congo - Kinshasa,INCLUDE,INCLUDE,INCLUDE,,,,,,, +CF,Central African Republic,INCLUDE,INCLUDE,INCLUDE,,,,,,, +CG,Congo - Brazzaville,INCLUDE,INCLUDE,,,,,,,, +CH,Switzerland,INCLUDE,INCLUDE,INCLUDE,,,INCLUDE,,,, +CI,Côte d’Ivoire,INCLUDE,INCLUDE,INCLUDE,,,,,,, +CK,Cook Islands,INCLUDE,,,,,,,,, +CL,Chile,INCLUDE,INCLUDE,INCLUDE,,,,,,, +CM,Cameroon,INCLUDE,INCLUDE,,,,,,,, +CN,China,INCLUDE,INCLUDE,,,,,,,, +CO,Colombia,INCLUDE,INCLUDE,INCLUDE,,,INCLUDE,,,, +CR,Costa Rica,INCLUDE,INCLUDE,,,,,,,, +CU,Cuba,INCLUDE,INCLUDE,,,,,,,, +CV,Cape Verde,INCLUDE,,,,,,,,, +CW,Curaçao,INCLUDE,,,,,,,,, +CX,Christmas Island,INCLUDE,,,,,INCLUDE,,,, +CY,Cyprus,INCLUDE,,,,,,,,, +CZ,Czechia,INCLUDE,INCLUDE,INCLUDE,,,,INCLUDE,,, +DE,Germany,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE, +DJ,Djibouti,INCLUDE,INCLUDE,,,,,,,, +DK,Denmark,INCLUDE,INCLUDE,INCLUDE,,,,,,, +DM,Dominica,INCLUDE,INCLUDE,,,,,,,, +DO,Dominican Republic,INCLUDE,INCLUDE,,,,,,,, +DZ,Algeria,INCLUDE,INCLUDE,INCLUDE,,,,,,, +EC,Ecuador,INCLUDE,INCLUDE,INCLUDE,,,,,,, +EE,Estonia,INCLUDE,INCLUDE,INCLUDE,,,INCLUDE,INCLUDE,,, +EG,Egypt,INCLUDE,INCLUDE,,,,,,,, +ER,Eritrea,INCLUDE,INCLUDE,,,,,,,, +ES,Spain,INCLUDE,INCLUDE,INCLUDE,,,INCLUDE,,,, +ET,Ethiopia,INCLUDE,INCLUDE,,,,,,,, +FI,Finland,INCLUDE,INCLUDE,INCLUDE,INCLUDE,,,,,, +FJ,Fiji,INCLUDE,INCLUDE,,,,,,,, +FK,Falkland Islands (Islas Malvinas),INCLUDE,,,,,,,,, +FM,Micronesia,INCLUDE,INCLUDE,,,,,,,, +FO,Faroe Islands,INCLUDE,INCLUDE,,,,,,,, +FR,France,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE, +GA,Gabon,INCLUDE,INCLUDE,,,,,,,, +GB,United Kingdom,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,,INCLUDE,,INCLUDE, +GD,Grenada,INCLUDE,INCLUDE,,,,,,,, +GE,Georgia,INCLUDE,INCLUDE,,,,,,,, +GF,French Guiana,INCLUDE,INCLUDE,,,,,,,, +GG,Guernsey,INCLUDE,INCLUDE,,,,,,,, +GH,Ghana,INCLUDE,INCLUDE,INCLUDE,,,,,,, +GI,Gibraltar,INCLUDE,,,,,INCLUDE,,,, +GL,Greenland,INCLUDE,INCLUDE,,,,,,,, +GM,Gambia,INCLUDE,INCLUDE,,,,,,,, +GN,Guinea,INCLUDE,INCLUDE,INCLUDE,,,,,,, +GP,Guadeloupe,INCLUDE,INCLUDE,INCLUDE,,,,,,, +GQ,Equatorial Guinea,INCLUDE,INCLUDE,,,,,,,, +GR,Greece,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,,,,, +GS,South Georgia & South Sandwich Islands,INCLUDE,,,,,INCLUDE,,,, +GT,Guatemala,INCLUDE,INCLUDE,INCLUDE,,,,,,, +GU,Guam,INCLUDE,,,,,,,,, +GW,Guinea-Bissau,INCLUDE,INCLUDE,,,,,,,, +GY,Guyana,INCLUDE,INCLUDE,,,,,,,, +HK,Hong Kong,INCLUDE,INCLUDE,INCLUDE,,,,,,, +HM,Heard & McDonald Islands,INCLUDE,,,,,,,,, +HN,Honduras,INCLUDE,INCLUDE,INCLUDE,,,,,,, +HR,Croatia,INCLUDE,INCLUDE,,,,,,,, +HT,Haiti,INCLUDE,INCLUDE,,,,,,,, +HU,Hungary,INCLUDE,INCLUDE,INCLUDE,,,,INCLUDE,,, +IC,Canary Islands,INCLUDE,INCLUDE,,,,,,,, +ID,Indonesia,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,,,,, +IE,Ireland,INCLUDE,INCLUDE,INCLUDE,,,,,,, +IL,Israel,INCLUDE,,,,,,,,, +IM,Isle of Man,INCLUDE,INCLUDE,,,,,,,, +IN,India,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,,, +IO,British Indian Ocean Territory,INCLUDE,,,,,,,,, +IQ,Iraq,INCLUDE,INCLUDE,,,,,,,, +IR,Iran,INCLUDE,INCLUDE,,,,,,,, +IS,Iceland,INCLUDE,INCLUDE,,,,INCLUDE,,,, +IT,Italy,INCLUDE,INCLUDE,INCLUDE,INCLUDE,,INCLUDE,,,, +JE,Jersey,INCLUDE,INCLUDE,,,,,,,, +JM,Jamaica,INCLUDE,INCLUDE,,,,,,,, +JO,Jordan,INCLUDE,INCLUDE,,,,,,,, +JP,Japan,INCLUDE,INCLUDE,INCLUDE,,,INCLUDE,INCLUDE,INCLUDE,INCLUDE, +KE,Kenya,INCLUDE,INCLUDE,,,,,,,, +KG,Kyrgyzstan,INCLUDE,INCLUDE,,,,,,,, +KH,Cambodia,INCLUDE,INCLUDE,INCLUDE,,,,,,, +KI,Kiribati,INCLUDE,INCLUDE,,,,,,,, +KM,Comoros,INCLUDE,INCLUDE,,,,,,,, +KN,St. Kitts & Nevis,INCLUDE,INCLUDE,,,,,,,, +KP,North Korea,INCLUDE,INCLUDE,,,,,,,, +KR,South Korea,INCLUDE,,,,,,,,, +KW,Kuwait,INCLUDE,INCLUDE,,,,,,,, +KY,Cayman Islands,INCLUDE,INCLUDE,,,,,,,, +KZ,Kazakhstan,INCLUDE,INCLUDE,,,,,,,, +LA,Laos,INCLUDE,INCLUDE,,,,,,,, +LB,Lebanon,INCLUDE,INCLUDE,INCLUDE,,,,,,, +LC,St. Lucia,INCLUDE,INCLUDE,,,,,,,, +LI,Liechtenstein,INCLUDE,INCLUDE,,,,,,,, +LK,Sri Lanka,INCLUDE,INCLUDE,INCLUDE,,,,,,, +LR,Liberia,INCLUDE,INCLUDE,,,,,,,, +LS,Lesotho,INCLUDE,INCLUDE,,,,,,,, +LT,Lithuania,INCLUDE,INCLUDE,INCLUDE,INCLUDE,,,,,, +LU,Luxembourg,INCLUDE,INCLUDE,,,,,INCLUDE,,, +LV,Latvia,INCLUDE,INCLUDE,INCLUDE,,,INCLUDE,,,, +LY,Libya,INCLUDE,INCLUDE,,,,,,,, +MA,Morocco,INCLUDE,,,,,,,,, +MC,Monaco,INCLUDE,,,,,,,,, +MD,Moldova,INCLUDE,INCLUDE,,,,,,,, +ME,Montenegro,INCLUDE,INCLUDE,INCLUDE,,,,,,, +MF,St. Martin,INCLUDE,,,,,INCLUDE,,,, +MG,Madagascar,INCLUDE,INCLUDE,,,,,,,, +MH,Marshall Islands,INCLUDE,INCLUDE,,,,,,,, +MK,North Macedonia,INCLUDE,INCLUDE,INCLUDE,,,,,,, +ML,Mali,INCLUDE,,,,,,,,, +MM,Myanmar (Burma),INCLUDE,INCLUDE,INCLUDE,,,,,,, +MN,Mongolia,INCLUDE,INCLUDE,,,,,,,, +MO,Macao,INCLUDE,,,,,,,,, +MP,Northern Mariana Islands,INCLUDE,INCLUDE,,,,INCLUDE,,,, +MQ,Martinique,INCLUDE,INCLUDE,,,,,,,, +MR,Mauritania,INCLUDE,INCLUDE,,,,,,,, +MS,Montserrat,INCLUDE,INCLUDE,,,,,,,, +MT,Malta,INCLUDE,,,,,,INCLUDE,,, +MU,Mauritius,INCLUDE,INCLUDE,,,,,,,, +MV,Maldives,INCLUDE,INCLUDE,,,,,,,, +MW,Malawi,INCLUDE,INCLUDE,INCLUDE,,,,,,, +MX,Mexico,INCLUDE,INCLUDE,INCLUDE,,,,,,, +MY,Malaysia,INCLUDE,INCLUDE,,,,,,,, +MZ,Mozambique,INCLUDE,INCLUDE,,,,,,,, +NA,Namibia,INCLUDE,INCLUDE,,,,,,,, +NC,New Caledonia,INCLUDE,INCLUDE,,,,,,,, +NE,Niger,INCLUDE,INCLUDE,,,,,,,, +NF,Norfolk Island,INCLUDE,,,,,,,,, +NG,Nigeria,INCLUDE,INCLUDE,,,,,,,, +NI,Nicaragua,INCLUDE,INCLUDE,,,,,,,, +NL,Netherlands,INCLUDE,INCLUDE,INCLUDE,,,,,,, +NO,Norway,INCLUDE,INCLUDE,INCLUDE,,,INCLUDE,,,, +NP,Nepal,INCLUDE,INCLUDE,INCLUDE,,,,,,, +NR,Nauru,INCLUDE,INCLUDE,,,,,,,, +NU,Niue,INCLUDE,INCLUDE,,,,,,,, +NZ,New Zealand,INCLUDE,INCLUDE,INCLUDE,,,,INCLUDE,,, +OM,Oman,INCLUDE,INCLUDE,,,,,,,, +PA,Panama,INCLUDE,INCLUDE,,,,,,,, +PE,Peru,INCLUDE,INCLUDE,INCLUDE,,,,,,, +PF,French Polynesia,INCLUDE,INCLUDE,,,,,,,, +PG,Papua New Guinea,INCLUDE,INCLUDE,INCLUDE,,,,,,, +PH,Philippines,INCLUDE,INCLUDE,INCLUDE,,,,,,, +PK,Pakistan,INCLUDE,,,,,,,,, +PL,Poland,INCLUDE,INCLUDE,INCLUDE,,,,,,, +PM,St. Pierre & Miquelon,INCLUDE,INCLUDE,,,,INCLUDE,,,, +PN,Pitcairn Islands,INCLUDE,,,,,INCLUDE,,,, +PR,Puerto Rico,INCLUDE,INCLUDE,,,,INCLUDE,,,, +PS,Palestine,INCLUDE,,,,,,,,, +PT,Portugal,INCLUDE,INCLUDE,INCLUDE,,,,,,, +PW,Palau,INCLUDE,INCLUDE,,,,,,,, +PY,Paraguay,INCLUDE,INCLUDE,,,,,,,, +QA,Qatar,INCLUDE,INCLUDE,,,,,,,, +RE,Réunion,INCLUDE,INCLUDE,INCLUDE,,,,,,, +RO,Romania,INCLUDE,INCLUDE,INCLUDE,,,,,,, +RS,Serbia,INCLUDE,INCLUDE,INCLUDE,,,,,,, +RW,Rwanda,INCLUDE,INCLUDE,INCLUDE,,,,,,, +SA,Saudi Arabia,INCLUDE,INCLUDE,,,,,,,, +SB,Solomon Islands,INCLUDE,INCLUDE,,,,,,,, +SC,Seychelles,INCLUDE,INCLUDE,,,,,,,, +SD,Sudan,INCLUDE,INCLUDE,,,,,,,, +SE,Sweden,INCLUDE,INCLUDE,INCLUDE,,,,,,, +SG,Singapore,INCLUDE,,,,,,,,, +SH,St. Helena,INCLUDE,INCLUDE,,,,,,,, +SI,Slovenia,INCLUDE,INCLUDE,INCLUDE,,,INCLUDE,INCLUDE,,, +SJ,Svalbard & Jan Mayen,INCLUDE,INCLUDE,,,,,,,, +SK,Slovakia,INCLUDE,INCLUDE,INCLUDE,,,INCLUDE,INCLUDE,,, +SL,Sierra Leone,INCLUDE,INCLUDE,,,,,,,, +SM,San Marino,INCLUDE,INCLUDE,,,,,,,, +SN,Senegal,INCLUDE,INCLUDE,INCLUDE,,,,,,, +SO,Somalia,INCLUDE,INCLUDE,,,,,,,, +SR,Suriname,INCLUDE,INCLUDE,,,,,,,, +SS,South Sudan,INCLUDE,,,,,,,,, +ST,São Tomé & Príncipe,INCLUDE,INCLUDE,,,,,,,, +SU,Russia,INCLUDE,INCLUDE,,,,,,,, +SV,El Salvador,INCLUDE,INCLUDE,,,,,,,, +SX,Sint Maarten,INCLUDE,INCLUDE,,,,,,,, +SY,Syria,INCLUDE,INCLUDE,,,,,,,, +SZ,Eswatini,INCLUDE,INCLUDE,,,,,,,, +TC,Turks & Caicos Islands,INCLUDE,INCLUDE,,,,INCLUDE,,,, +TD,Chad,INCLUDE,INCLUDE,INCLUDE,,,,,,, +TF,French Southern Territories,INCLUDE,,,,,,,,, +TG,Togo,INCLUDE,INCLUDE,,,,,,,, +TH,Thailand,INCLUDE,INCLUDE,,,,INCLUDE,INCLUDE,,, +TJ,Tajikistan,INCLUDE,INCLUDE,,,,,,,, +TK,Tokelau,INCLUDE,INCLUDE,,,,,,,, +TL,Timor-Leste,INCLUDE,INCLUDE,,,,,,,, +TM,Turkmenistan,INCLUDE,INCLUDE,,,,,,,, +TN,Tunisia,INCLUDE,INCLUDE,,,,,,,, +TO,Tonga,INCLUDE,INCLUDE,,,,,,,, +TR,Türkiye,INCLUDE,INCLUDE,,,,,,,, +TT,Trinidad & Tobago,INCLUDE,INCLUDE,,,,,,,, +TV,Tuvalu,INCLUDE,INCLUDE,,,,,,,, +TW,Taiwan,INCLUDE,INCLUDE,INCLUDE,,,,,,, +TZ,Tanzania,INCLUDE,INCLUDE,,,,,,,, +UA,Ukraine,INCLUDE,INCLUDE,,,,,,,, +UG,Uganda,INCLUDE,INCLUDE,,,,,,,, +UM,U.S. Outlying Islands,INCLUDE,,,,,,,,, +US,United States,INCLUDE,INCLUDE,INCLUDE,,,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE +UY,Uruguay,INCLUDE,INCLUDE,,,,,,,, +UZ,Uzbekistan,INCLUDE,INCLUDE,,,,,,,, +VA,Vatican City,INCLUDE,,,,,,,,, +VC,St. Vincent & Grenadines,INCLUDE,INCLUDE,,,,,,,, +VE,Venezuela,INCLUDE,INCLUDE,INCLUDE,,,,,,, +VG,British Virgin Islands,INCLUDE,INCLUDE,,,,,,,, +VI,U.S. Virgin Islands,INCLUDE,INCLUDE,INCLUDE,,,,,,, +VN,Vietnam,INCLUDE,INCLUDE,,,,,,,, +VU,Vanuatu,INCLUDE,INCLUDE,,,,,,,, +WF,Wallis & Futuna,INCLUDE,INCLUDE,,,,,,,, +WS,Samoa,INCLUDE,INCLUDE,,,,,,,, +XK,Kosovo,INCLUDE,INCLUDE,,,,,,,, +YE,Yemen,INCLUDE,INCLUDE,,,,,,,, +YT,Mayotte,INCLUDE,INCLUDE,,,,,,,, +ZA,South Africa,INCLUDE,INCLUDE,INCLUDE,,,,,,, +ZM,Zambia,INCLUDE,INCLUDE,,,,,,,, +ZW,Zimbabwe,INCLUDE,INCLUDE,,,,,,,, \ No newline at end of file diff --git a/samples/dds-region-viewer/scripts/countries-JSON.csv b/samples/dds-region-viewer/scripts/countries-JSON.csv new file mode 100644 index 00000000..7694cd70 --- /dev/null +++ b/samples/dds-region-viewer/scripts/countries-JSON.csv @@ -0,0 +1,251 @@ +Country Code,Country Name En,Country,Administrative Area1,Administrative Area2,Administrative Area3,Administrative Area4,Postal Code,Locality,Sublocality1,Neighborhood,School District +AF,Afghanistan,INCLUDE,INCLUDE,,,,,,,, +AX,Åland Islands,INCLUDE,INCLUDE,,,,,,,, +AL,Albania,INCLUDE,INCLUDE,,,,,,,, +DZ,Algeria,INCLUDE,INCLUDE,INCLUDE,,,,,,, +AS,American Samoa,INCLUDE,INCLUDE,INCLUDE,,,,,,, +AD,Andorra,INCLUDE,INCLUDE,,,,INCLUDE,,,, +AO,Angola,INCLUDE,INCLUDE,INCLUDE,,,,,,, +AI,Anguilla,INCLUDE,,,,,,,,, +AQ,Antarctica,INCLUDE,,,,,,,,, +AG,Antigua & Barbuda,INCLUDE,INCLUDE,,,,,,,, +AR,Argentina,INCLUDE,INCLUDE,INCLUDE,,,,,,, +AM,Armenia,INCLUDE,INCLUDE,,,,,,,, +AW,Aruba,INCLUDE,,,,,,,,, +AU,Australia,INCLUDE,INCLUDE,INCLUDE,,,,INCLUDE,,, +AT,Austria,INCLUDE,INCLUDE,INCLUDE,INCLUDE,,,,,, +AZ,Azerbaijan,INCLUDE,INCLUDE,INCLUDE,,,,,,, +BS,Bahamas,INCLUDE,INCLUDE,,,,,,,, +BH,Bahrain,INCLUDE,INCLUDE,,,,,,,, +BD,Bangladesh,INCLUDE,INCLUDE,INCLUDE,,,,,,, +BB,Barbados,INCLUDE,INCLUDE,,,,,,,, +BY,Belarus,INCLUDE,INCLUDE,INCLUDE,,,,,,, +BE,Belgium,INCLUDE,INCLUDE,INCLUDE,INCLUDE,,INCLUDE,INCLUDE,,, +BZ,Belize,INCLUDE,INCLUDE,,,,,,,, +BJ,Benin,INCLUDE,INCLUDE,,,,,,,, +BM,Bermuda,INCLUDE,INCLUDE,,,,,,,, +BT,Bhutan,INCLUDE,INCLUDE,,,,,,,, +BO,Bolivia,INCLUDE,INCLUDE,INCLUDE,,,,,,, +BA,Bosnia & Herzegovina,INCLUDE,INCLUDE,INCLUDE,,,,,,, +BW,Botswana,INCLUDE,INCLUDE,,,,,,,, +BV,Bouvet Island,INCLUDE,,,,,,,,, +BR,Brazil,INCLUDE,INCLUDE,INCLUDE,,INCLUDE,,,,, +IO,British Indian Ocean Territory,INCLUDE,,,,,,,,, +VG,British Virgin Islands,INCLUDE,INCLUDE,,,,,,,, +BN,Brunei,INCLUDE,INCLUDE,,,,,,,, +BG,Bulgaria,INCLUDE,INCLUDE,INCLUDE,,,,INCLUDE,,, +BF,Burkina Faso,INCLUDE,INCLUDE,INCLUDE,,,,,,, +BI,Burundi,INCLUDE,INCLUDE,,,,,,,, +KH,Cambodia,INCLUDE,INCLUDE,INCLUDE,,,,,,, +CM,Cameroon,INCLUDE,INCLUDE,,,,,,,, +CA,Canada,INCLUDE,INCLUDE,,,,,,,, +IC,Canary Islands,INCLUDE,INCLUDE,,,,,,,, +CV,Cape Verde,INCLUDE,,,,,,,,, +BQ,Caribbean Netherlands,INCLUDE,INCLUDE,,,,,,,, +KY,Cayman Islands,INCLUDE,INCLUDE,,,,,,,, +CF,Central African Republic,INCLUDE,INCLUDE,INCLUDE,,,,,,, +TD,Chad,INCLUDE,INCLUDE,INCLUDE,,,,,,, +CL,Chile,INCLUDE,INCLUDE,INCLUDE,,,,,,, +CN,China,INCLUDE,INCLUDE,,,,,,,, +CX,Christmas Island,INCLUDE,,,,,INCLUDE,,,, +CC,Cocos (Keeling) Islands,INCLUDE,INCLUDE,,,,INCLUDE,,,, +CO,Colombia,INCLUDE,INCLUDE,INCLUDE,,,INCLUDE,,,, +KM,Comoros,INCLUDE,INCLUDE,,,,,,,, +CG,Congo - Brazzaville,INCLUDE,INCLUDE,,,,,,,, +CD,Congo - Kinshasa,INCLUDE,INCLUDE,INCLUDE,,,,,,, +CK,Cook Islands,INCLUDE,,,,,,,,, +CR,Costa Rica,INCLUDE,INCLUDE,,,,,,,, +CI,Côte d’Ivoire,INCLUDE,INCLUDE,INCLUDE,,,,,,, +HR,Croatia,INCLUDE,INCLUDE,,,,,,,, +CU,Cuba,INCLUDE,INCLUDE,,,,,,,, +CW,Curaçao,INCLUDE,,,,,,,,, +CY,Cyprus,INCLUDE,,,,,,,,, +CZ,Czechia,INCLUDE,INCLUDE,INCLUDE,,,,INCLUDE,,, +DK,Denmark,INCLUDE,INCLUDE,INCLUDE,,,,,,, +DJ,Djibouti,INCLUDE,INCLUDE,,,,,,,, +DM,Dominica,INCLUDE,INCLUDE,,,,,,,, +DO,Dominican Republic,INCLUDE,INCLUDE,,,,,,,, +EC,Ecuador,INCLUDE,INCLUDE,INCLUDE,,,,,,, +EG,Egypt,INCLUDE,INCLUDE,,,,,,,, +SV,El Salvador,INCLUDE,INCLUDE,,,,,,,, +GQ,Equatorial Guinea,INCLUDE,INCLUDE,,,,,,,, +ER,Eritrea,INCLUDE,INCLUDE,,,,,,,, +EE,Estonia,INCLUDE,INCLUDE,INCLUDE,,,INCLUDE,INCLUDE,,, +SZ,Eswatini,INCLUDE,INCLUDE,,,,,,,, +ET,Ethiopia,INCLUDE,INCLUDE,,,,,,,, +FK,Falkland Islands (Islas Malvinas),INCLUDE,,,,,,,,, +FO,Faroe Islands,INCLUDE,INCLUDE,,,,,,,, +FJ,Fiji,INCLUDE,INCLUDE,,,,,,,, +FI,Finland,INCLUDE,INCLUDE,INCLUDE,INCLUDE,,,,,, +FR,France,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE, +GF,French Guiana,INCLUDE,INCLUDE,,,,,,,, +PF,French Polynesia,INCLUDE,INCLUDE,,,,,,,, +TF,French Southern Territories,INCLUDE,,,,,,,,, +GA,Gabon,INCLUDE,INCLUDE,,,,,,,, +GM,Gambia,INCLUDE,INCLUDE,,,,,,,, +GE,Georgia,INCLUDE,INCLUDE,,,,,,,, +DE,Germany,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE, +GH,Ghana,INCLUDE,INCLUDE,INCLUDE,,,,,,, +GI,Gibraltar,INCLUDE,,,,,INCLUDE,,,, +GR,Greece,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,,,,, +GL,Greenland,INCLUDE,INCLUDE,,,,,,,, +GD,Grenada,INCLUDE,INCLUDE,,,,,,,, +GP,Guadeloupe,INCLUDE,INCLUDE,INCLUDE,,,,,,, +GU,Guam,INCLUDE,,,,,,,,, +GT,Guatemala,INCLUDE,INCLUDE,INCLUDE,,,,,,, +GG,Guernsey,INCLUDE,INCLUDE,,,,,,,, +GN,Guinea,INCLUDE,INCLUDE,INCLUDE,,,,,,, +GW,Guinea-Bissau,INCLUDE,INCLUDE,,,,,,,, +GY,Guyana,INCLUDE,INCLUDE,,,,,,,, +HT,Haiti,INCLUDE,INCLUDE,,,,,,,, +HM,Heard & McDonald Islands,INCLUDE,,,,,,,,, +HN,Honduras,INCLUDE,INCLUDE,INCLUDE,,,,,,, +HK,Hong Kong,INCLUDE,INCLUDE,INCLUDE,,,,,,, +HU,Hungary,INCLUDE,INCLUDE,INCLUDE,,,,INCLUDE,,, +IS,Iceland,INCLUDE,INCLUDE,,,,INCLUDE,,,, +IN,India,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,,, +ID,Indonesia,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,,,,, +IR,Iran,INCLUDE,INCLUDE,,,,,,,, +IQ,Iraq,INCLUDE,INCLUDE,,,,,,,, +IE,Ireland,INCLUDE,INCLUDE,INCLUDE,,,,,,, +IM,Isle of Man,INCLUDE,INCLUDE,,,,,,,, +IL,Israel,INCLUDE,,,,,,,,, +IT,Italy,INCLUDE,INCLUDE,INCLUDE,INCLUDE,,INCLUDE,,,, +JM,Jamaica,INCLUDE,INCLUDE,,,,,,,, +JP,Japan,INCLUDE,INCLUDE,INCLUDE,,,INCLUDE,INCLUDE,INCLUDE,INCLUDE, +JE,Jersey,INCLUDE,INCLUDE,,,,,,,, +JO,Jordan,INCLUDE,INCLUDE,,,,,,,, +KZ,Kazakhstan,INCLUDE,INCLUDE,,,,,,,, +KE,Kenya,INCLUDE,INCLUDE,,,,,,,, +KI,Kiribati,INCLUDE,INCLUDE,,,,,,,, +XK,Kosovo,INCLUDE,INCLUDE,,,,,,,, +KW,Kuwait,INCLUDE,INCLUDE,,,,,,,, +KG,Kyrgyzstan,INCLUDE,INCLUDE,,,,,,,, +LA,Laos,INCLUDE,INCLUDE,,,,,,,, +LV,Latvia,INCLUDE,INCLUDE,INCLUDE,,,INCLUDE,,,, +LB,Lebanon,INCLUDE,INCLUDE,INCLUDE,,,,,,, +LS,Lesotho,INCLUDE,INCLUDE,,,,,,,, +LR,Liberia,INCLUDE,INCLUDE,,,,,,,, +LY,Libya,INCLUDE,INCLUDE,,,,,,,, +LI,Liechtenstein,INCLUDE,INCLUDE,,,,,,,, +LT,Lithuania,INCLUDE,INCLUDE,INCLUDE,INCLUDE,,,,,, +LU,Luxembourg,INCLUDE,INCLUDE,,,,,INCLUDE,,, +MO,Macao,INCLUDE,,,,,,,,, +MG,Madagascar,INCLUDE,INCLUDE,,,,,,,, +MW,Malawi,INCLUDE,INCLUDE,INCLUDE,,,,,,, +MY,Malaysia,INCLUDE,INCLUDE,,,,,,,, +MV,Maldives,INCLUDE,INCLUDE,,,,,,,, +ML,Mali,INCLUDE,,,,,,,,, +MT,Malta,INCLUDE,,,,,,INCLUDE,,, +MH,Marshall Islands,INCLUDE,INCLUDE,,,,,,,, +MQ,Martinique,INCLUDE,INCLUDE,,,,,,,, +MR,Mauritania,INCLUDE,INCLUDE,,,,,,,, +MU,Mauritius,INCLUDE,INCLUDE,,,,,,,, +YT,Mayotte,INCLUDE,INCLUDE,,,,,,,, +MX,Mexico,INCLUDE,INCLUDE,INCLUDE,,,,,,, +FM,Micronesia,INCLUDE,INCLUDE,,,,,,,, +MD,Moldova,INCLUDE,INCLUDE,,,,,,,, +MC,Monaco,INCLUDE,,,,,,,,, +MN,Mongolia,INCLUDE,INCLUDE,,,,,,,, +ME,Montenegro,INCLUDE,INCLUDE,INCLUDE,,,,,,, +MS,Montserrat,INCLUDE,INCLUDE,,,,,,,, +MA,Morocco,INCLUDE,,,,,,,,, +MZ,Mozambique,INCLUDE,INCLUDE,,,,,,,, +MM,Myanmar (Burma),INCLUDE,INCLUDE,INCLUDE,,,,,,, +NA,Namibia,INCLUDE,INCLUDE,,,,,,,, +NR,Nauru,INCLUDE,INCLUDE,,,,,,,, +NP,Nepal,INCLUDE,INCLUDE,INCLUDE,,,,,,, +NL,Netherlands,INCLUDE,INCLUDE,INCLUDE,,,,,,, +NC,New Caledonia,INCLUDE,INCLUDE,,,,,,,, +NZ,New Zealand,INCLUDE,INCLUDE,INCLUDE,,,,INCLUDE,,, +NI,Nicaragua,INCLUDE,INCLUDE,,,,,,,, +NE,Niger,INCLUDE,INCLUDE,,,,,,,, +NG,Nigeria,INCLUDE,INCLUDE,,,,,,,, +NU,Niue,INCLUDE,INCLUDE,,,,,,,, +NF,Norfolk Island,INCLUDE,,,,,,,,, +KP,North Korea,INCLUDE,INCLUDE,,,,,,,, +MK,North Macedonia,INCLUDE,INCLUDE,INCLUDE,,,,,,, +MP,Northern Mariana Islands,INCLUDE,INCLUDE,,,,INCLUDE,,,, +NO,Norway,INCLUDE,INCLUDE,INCLUDE,,,INCLUDE,,,, +OM,Oman,INCLUDE,INCLUDE,,,,,,,, +PK,Pakistan,INCLUDE,,,,,,,,, +PW,Palau,INCLUDE,INCLUDE,,,,,,,, +PS,Palestine,INCLUDE,,,,,,,,, +PA,Panama,INCLUDE,INCLUDE,,,,,,,, +PG,Papua New Guinea,INCLUDE,INCLUDE,INCLUDE,,,,,,, +PY,Paraguay,INCLUDE,INCLUDE,,,,,,,, +PE,Peru,INCLUDE,INCLUDE,INCLUDE,,,,,,, +PH,Philippines,INCLUDE,INCLUDE,INCLUDE,,,,,,, +PN,Pitcairn Islands,INCLUDE,,,,,INCLUDE,,,, +PL,Poland,INCLUDE,INCLUDE,INCLUDE,,,,,,, +PT,Portugal,INCLUDE,INCLUDE,INCLUDE,,,,,,, +PR,Puerto Rico,INCLUDE,INCLUDE,,,,INCLUDE,,,, +QA,Qatar,INCLUDE,INCLUDE,,,,,,,, +RE,Réunion,INCLUDE,INCLUDE,INCLUDE,,,,,,, +RO,Romania,INCLUDE,INCLUDE,INCLUDE,,,,,,, +SU,Russia,INCLUDE,INCLUDE,,,,,,,, +RW,Rwanda,INCLUDE,INCLUDE,INCLUDE,,,,,,, +WS,Samoa,INCLUDE,INCLUDE,,,,,,,, +SM,San Marino,INCLUDE,INCLUDE,,,,,,,, +ST,São Tomé & Príncipe,INCLUDE,INCLUDE,,,,,,,, +SA,Saudi Arabia,INCLUDE,INCLUDE,,,,,,,, +SN,Senegal,INCLUDE,INCLUDE,INCLUDE,,,,,,, +RS,Serbia,INCLUDE,INCLUDE,INCLUDE,,,,,,, +SC,Seychelles,INCLUDE,INCLUDE,,,,,,,, +SL,Sierra Leone,INCLUDE,INCLUDE,,,,,,,, +SG,Singapore,INCLUDE,,,,,,,,, +SX,Sint Maarten,INCLUDE,INCLUDE,,,,,,,, +SK,Slovakia,INCLUDE,INCLUDE,INCLUDE,,,INCLUDE,INCLUDE,,, +SI,Slovenia,INCLUDE,INCLUDE,INCLUDE,,,INCLUDE,INCLUDE,,, +SB,Solomon Islands,INCLUDE,INCLUDE,,,,,,,, +SO,Somalia,INCLUDE,INCLUDE,,,,,,,, +ZA,South Africa,INCLUDE,INCLUDE,INCLUDE,,,,,,, +GS,South Georgia & South Sandwich Islands,INCLUDE,,,,,INCLUDE,,,, +KR,South Korea,INCLUDE,,,,,,,,, +SS,South Sudan,INCLUDE,,,,,,,,, +ES,Spain,INCLUDE,INCLUDE,INCLUDE,,,INCLUDE,,,, +LK,Sri Lanka,INCLUDE,INCLUDE,INCLUDE,,,,,,, +BL,St. Barthélemy,INCLUDE,,,,,,,,, +SH,St. Helena,INCLUDE,INCLUDE,,,,,,,, +KN,St. Kitts & Nevis,INCLUDE,INCLUDE,,,,,,,, +LC,St. Lucia,INCLUDE,INCLUDE,,,,,,,, +MF,St. Martin,INCLUDE,,,,,INCLUDE,,,, +PM,St. Pierre & Miquelon,INCLUDE,INCLUDE,,,,INCLUDE,,,, +VC,St. Vincent & Grenadines,INCLUDE,INCLUDE,,,,,,,, +SD,Sudan,INCLUDE,INCLUDE,,,,,,,, +SR,Suriname,INCLUDE,INCLUDE,,,,,,,, +SJ,Svalbard & Jan Mayen,INCLUDE,INCLUDE,,,,,,,, +SE,Sweden,INCLUDE,INCLUDE,INCLUDE,,,,,,, +CH,Switzerland,INCLUDE,INCLUDE,INCLUDE,,,INCLUDE,,,, +SY,Syria,INCLUDE,INCLUDE,,,,,,,, +TW,Taiwan,INCLUDE,INCLUDE,INCLUDE,,,,,,, +TJ,Tajikistan,INCLUDE,INCLUDE,,,,,,,, +TZ,Tanzania,INCLUDE,INCLUDE,,,,,,,, +TH,Thailand,INCLUDE,INCLUDE,,,,INCLUDE,INCLUDE,,, +TL,Timor-Leste,INCLUDE,INCLUDE,,,,,,,, +TG,Togo,INCLUDE,INCLUDE,,,,,,,, +TK,Tokelau,INCLUDE,INCLUDE,,,,,,,, +TO,Tonga,INCLUDE,INCLUDE,,,,,,,, +TT,Trinidad & Tobago,INCLUDE,INCLUDE,,,,,,,, +TN,Tunisia,INCLUDE,INCLUDE,,,,,,,, +TR,Türkiye,INCLUDE,INCLUDE,,,,,,,, +TM,Turkmenistan,INCLUDE,INCLUDE,,,,,,,, +TC,Turks & Caicos Islands,INCLUDE,INCLUDE,,,,INCLUDE,,,, +TV,Tuvalu,INCLUDE,INCLUDE,,,,,,,, +UM,U.S. Outlying Islands,INCLUDE,,,,,,,,, +VI,U.S. Virgin Islands,INCLUDE,INCLUDE,INCLUDE,,,,,,, +UG,Uganda,INCLUDE,INCLUDE,,,,,,,, +UA,Ukraine,INCLUDE,INCLUDE,,,,,,,, +AE,United Arab Emirates,INCLUDE,,,,,,,,, +GB,United Kingdom,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE,,INCLUDE,,INCLUDE, +US,United States,INCLUDE,INCLUDE,INCLUDE,,,INCLUDE,INCLUDE,INCLUDE,INCLUDE,INCLUDE +UY,Uruguay,INCLUDE,INCLUDE,,,,,,,, +UZ,Uzbekistan,INCLUDE,INCLUDE,,,,,,,, +VU,Vanuatu,INCLUDE,INCLUDE,,,,,,,, +VA,Vatican City,INCLUDE,,,,,,,,, +VE,Venezuela,INCLUDE,INCLUDE,INCLUDE,,,,,,, +VN,Vietnam,INCLUDE,INCLUDE,,,,,,,, +WF,Wallis & Futuna,INCLUDE,INCLUDE,,,,,,,, +YE,Yemen,INCLUDE,INCLUDE,,,,,,,, +ZM,Zambia,INCLUDE,INCLUDE,,,,,,,, +ZW,Zimbabwe,INCLUDE,INCLUDE,,,,,,,, \ No newline at end of file diff --git a/samples/dds-region-viewer/scripts/csv_to_html.py b/samples/dds-region-viewer/scripts/csv_to_html.py new file mode 100644 index 00000000..155d3878 --- /dev/null +++ b/samples/dds-region-viewer/scripts/csv_to_html.py @@ -0,0 +1,79 @@ +import csv + +table = "" +tr = "" + +file_name = "countries-HTML.csv" + +with open(file_name) as file: + table += """ + \n""" + + csv_reader_object = csv.reader(file) + next(csv_reader_object) + + for line in csv_reader_object: + countryCode = line[0] + countryName = line [1] + country = line[2] + admin1 = line[3] + admin2 = line[4] + admin3 = line[5] + admin4 = line[6] + postalCode = line[7] + locality = line[8] + sublocality1 = line[9] + neighborhood = line[10] + schoolDistrict = line[11] + + tr += "" + tr += "\n" % countryCode + tr += "\n" % countryName + + if "INCLUDE" in country: + tr += "\n" + else: + tr += "\n" + + if "INCLUDE" in admin1: + tr += "\n" + else: + tr += "\n" + + if "INCLUDE" in admin2: + tr += "\n" + else: + tr += "\n" + + if "INCLUDE" in postalCode: + tr += "\n" + else: + tr += "\n" + + if "INCLUDE" in locality: + tr += "\n" + else: + tr += "\n" + + # if "INCLUDE" in sublocality1: + # tr += "\n" + # else: + # tr += "\n" + + # if "INCLUDE" in neighborhood: + # tr += "\n" + # else: + # tr += "\n" + + if "INCLUDE" in schoolDistrict: + tr += "\n" + else: + tr += "\n" + + tr += "\n" + +end = "
Region CodeCountry/RegionCountryAdmin Area 1Admin Area 2Postal codeLocalitySchool district
%s%s------------------------
" +html = table + tr + end +files = open("countries.html", "w+") +files.write(html) +files.close() \ No newline at end of file diff --git a/samples/dds-region-viewer/scripts/csv_to_json.py b/samples/dds-region-viewer/scripts/csv_to_json.py new file mode 100644 index 00000000..21300401 --- /dev/null +++ b/samples/dds-region-viewer/scripts/csv_to_json.py @@ -0,0 +1,73 @@ +import csv +import os +import json + +# --- Configuration --- +script_dir = os.path.dirname(os.path.abspath(__file__)) +file_name = os.path.join(script_dir, "countries-JSON.csv") +output_file = os.path.join(script_dir, "../src/countries.json") + +# 1. Initialize an empty list to hold all the country dictionaries +json_data = [] + +# --- Data Processing --- + +# Use 'r' mode for reading +try: + with open(file_name, mode='r', encoding='utf-8') as file: + # Use csv.DictReader to read rows as dictionaries, using the header row as keys. + csv_reader_object = csv.reader(file) + + # Skip the header row + next(csv_reader_object) + + # Iterate through each row in the CSV + for line in csv_reader_object: + countryCode = line[0] + countryName = line [1] + country = line[2] + admin1 = line[3] + admin2 = line[4] + # admin3 = line[5] # Not used in output structure + # admin4 = line[6] # Not used in output structure + postalCode = line[7] + locality = line[8] + # sublocality1 = line[9] # Not used in output structure + # neighborhood = line[10] # Not used in output structure + schoolDistrict = line[11] + + # 2. Build the Python dictionary object for the current entry + entry_dict = { + "name": countryName, + "code": countryCode, + "feature": { + # Boolean logic is cleaner when checking membership/value + "country": "INCLUDE" in country, + "administrative_area_level_1": "INCLUDE" in admin1, + "administrative_area_level_2": "INCLUDE" in admin2, + "postal_code": "INCLUDE" in postalCode, + "locality": "INCLUDE" in locality, + "school_district": "INCLUDE" in schoolDistrict + } + } + + # 3. Add the complete dictionary to the main list + json_data.append(entry_dict) + +except FileNotFoundError: + print(f"Error: CSV file not found at {file_name}") + exit() + +# --- Output File Writing --- + +# 4. Use json.dump() to write the entire list to the file +# 'w' mode for writing (will overwrite file if it exists) +try: + with open(output_file, 'w', encoding='utf-8') as write_file: + # json.dump() handles serialization, indentation, and ALL commas correctly! + json.dump(json_data, write_file, indent=4) + + print(f"Successfully created JSON file at {output_file}") + +except Exception as e: + print(f"An error occurred during JSON writing: {e}") \ No newline at end of file diff --git a/samples/dds-region-viewer/src/countries.json b/samples/dds-region-viewer/src/countries.json new file mode 100644 index 00000000..169cf43a --- /dev/null +++ b/samples/dds-region-viewer/src/countries.json @@ -0,0 +1,3002 @@ +[ + { + "name": "Afghanistan", + "code": "AF", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "\u00c5land Islands", + "code": "AX", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Albania", + "code": "AL", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Algeria", + "code": "DZ", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "American Samoa", + "code": "AS", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Andorra", + "code": "AD", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": true, + "locality": false, + "school_district": false + } + }, + { + "name": "Angola", + "code": "AO", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Anguilla", + "code": "AI", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Antarctica", + "code": "AQ", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Antigua & Barbuda", + "code": "AG", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Argentina", + "code": "AR", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Armenia", + "code": "AM", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Aruba", + "code": "AW", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Australia", + "code": "AU", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": true, + "school_district": false + } + }, + { + "name": "Austria", + "code": "AT", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Azerbaijan", + "code": "AZ", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Bahamas", + "code": "BS", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Bahrain", + "code": "BH", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Bangladesh", + "code": "BD", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Barbados", + "code": "BB", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Belarus", + "code": "BY", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Belgium", + "code": "BE", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": true, + "locality": true, + "school_district": false + } + }, + { + "name": "Belize", + "code": "BZ", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Benin", + "code": "BJ", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Bermuda", + "code": "BM", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Bhutan", + "code": "BT", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Bolivia", + "code": "BO", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Bosnia & Herzegovina", + "code": "BA", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Botswana", + "code": "BW", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Bouvet Island", + "code": "BV", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Brazil", + "code": "BR", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "British Indian Ocean Territory", + "code": "IO", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "British Virgin Islands", + "code": "VG", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Brunei", + "code": "BN", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Bulgaria", + "code": "BG", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": true, + "school_district": false + } + }, + { + "name": "Burkina Faso", + "code": "BF", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Burundi", + "code": "BI", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Cambodia", + "code": "KH", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Cameroon", + "code": "CM", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Canada", + "code": "CA", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Canary Islands", + "code": "IC", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Cape Verde", + "code": "CV", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Caribbean Netherlands", + "code": "BQ", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Cayman Islands", + "code": "KY", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Central African Republic", + "code": "CF", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Chad", + "code": "TD", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Chile", + "code": "CL", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "China", + "code": "CN", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Christmas Island", + "code": "CX", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": true, + "locality": false, + "school_district": false + } + }, + { + "name": "Cocos (Keeling) Islands", + "code": "CC", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": true, + "locality": false, + "school_district": false + } + }, + { + "name": "Colombia", + "code": "CO", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": true, + "locality": false, + "school_district": false + } + }, + { + "name": "Comoros", + "code": "KM", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Congo - Brazzaville", + "code": "CG", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Congo - Kinshasa", + "code": "CD", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Cook Islands", + "code": "CK", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Costa Rica", + "code": "CR", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "C\u00f4te d\u2019Ivoire", + "code": "CI", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Croatia", + "code": "HR", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Cuba", + "code": "CU", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Cura\u00e7ao", + "code": "CW", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Cyprus", + "code": "CY", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Czechia", + "code": "CZ", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": true, + "school_district": false + } + }, + { + "name": "Denmark", + "code": "DK", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Djibouti", + "code": "DJ", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Dominica", + "code": "DM", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Dominican Republic", + "code": "DO", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Ecuador", + "code": "EC", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Egypt", + "code": "EG", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "El Salvador", + "code": "SV", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Equatorial Guinea", + "code": "GQ", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Eritrea", + "code": "ER", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Estonia", + "code": "EE", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": true, + "locality": true, + "school_district": false + } + }, + { + "name": "Eswatini", + "code": "SZ", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Ethiopia", + "code": "ET", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Falkland Islands (Islas Malvinas)", + "code": "FK", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Faroe Islands", + "code": "FO", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Fiji", + "code": "FJ", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Finland", + "code": "FI", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "France", + "code": "FR", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": true, + "locality": true, + "school_district": false + } + }, + { + "name": "French Guiana", + "code": "GF", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "French Polynesia", + "code": "PF", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "French Southern Territories", + "code": "TF", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Gabon", + "code": "GA", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Gambia", + "code": "GM", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Georgia", + "code": "GE", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Germany", + "code": "DE", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": true, + "locality": true, + "school_district": false + } + }, + { + "name": "Ghana", + "code": "GH", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Gibraltar", + "code": "GI", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": true, + "locality": false, + "school_district": false + } + }, + { + "name": "Greece", + "code": "GR", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Greenland", + "code": "GL", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Grenada", + "code": "GD", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Guadeloupe", + "code": "GP", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Guam", + "code": "GU", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Guatemala", + "code": "GT", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Guernsey", + "code": "GG", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Guinea", + "code": "GN", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Guinea-Bissau", + "code": "GW", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Guyana", + "code": "GY", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Haiti", + "code": "HT", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Heard & McDonald Islands", + "code": "HM", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Honduras", + "code": "HN", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Hong Kong", + "code": "HK", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Hungary", + "code": "HU", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": true, + "school_district": false + } + }, + { + "name": "Iceland", + "code": "IS", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": true, + "locality": false, + "school_district": false + } + }, + { + "name": "India", + "code": "IN", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": true, + "locality": true, + "school_district": false + } + }, + { + "name": "Indonesia", + "code": "ID", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Iran", + "code": "IR", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Iraq", + "code": "IQ", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Ireland", + "code": "IE", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Isle of Man", + "code": "IM", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Israel", + "code": "IL", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Italy", + "code": "IT", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": true, + "locality": false, + "school_district": false + } + }, + { + "name": "Jamaica", + "code": "JM", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Japan", + "code": "JP", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": true, + "locality": true, + "school_district": false + } + }, + { + "name": "Jersey", + "code": "JE", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Jordan", + "code": "JO", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Kazakhstan", + "code": "KZ", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Kenya", + "code": "KE", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Kiribati", + "code": "KI", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Kosovo", + "code": "XK", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Kuwait", + "code": "KW", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Kyrgyzstan", + "code": "KG", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Laos", + "code": "LA", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Latvia", + "code": "LV", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": true, + "locality": false, + "school_district": false + } + }, + { + "name": "Lebanon", + "code": "LB", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Lesotho", + "code": "LS", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Liberia", + "code": "LR", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Libya", + "code": "LY", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Liechtenstein", + "code": "LI", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Lithuania", + "code": "LT", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Luxembourg", + "code": "LU", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": true, + "school_district": false + } + }, + { + "name": "Macao", + "code": "MO", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Madagascar", + "code": "MG", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Malawi", + "code": "MW", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Malaysia", + "code": "MY", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Maldives", + "code": "MV", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Mali", + "code": "ML", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Malta", + "code": "MT", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": true, + "school_district": false + } + }, + { + "name": "Marshall Islands", + "code": "MH", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Martinique", + "code": "MQ", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Mauritania", + "code": "MR", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Mauritius", + "code": "MU", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Mayotte", + "code": "YT", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Mexico", + "code": "MX", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Micronesia", + "code": "FM", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Moldova", + "code": "MD", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Monaco", + "code": "MC", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Mongolia", + "code": "MN", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Montenegro", + "code": "ME", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Montserrat", + "code": "MS", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Morocco", + "code": "MA", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Mozambique", + "code": "MZ", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Myanmar (Burma)", + "code": "MM", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Namibia", + "code": "NA", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Nauru", + "code": "NR", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Nepal", + "code": "NP", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Netherlands", + "code": "NL", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "New Caledonia", + "code": "NC", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "New Zealand", + "code": "NZ", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": true, + "school_district": false + } + }, + { + "name": "Nicaragua", + "code": "NI", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Niger", + "code": "NE", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Nigeria", + "code": "NG", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Niue", + "code": "NU", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Norfolk Island", + "code": "NF", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "North Korea", + "code": "KP", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "North Macedonia", + "code": "MK", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Northern Mariana Islands", + "code": "MP", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": true, + "locality": false, + "school_district": false + } + }, + { + "name": "Norway", + "code": "NO", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": true, + "locality": false, + "school_district": false + } + }, + { + "name": "Oman", + "code": "OM", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Pakistan", + "code": "PK", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Palau", + "code": "PW", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Palestine", + "code": "PS", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Panama", + "code": "PA", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Papua New Guinea", + "code": "PG", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Paraguay", + "code": "PY", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Peru", + "code": "PE", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Philippines", + "code": "PH", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Pitcairn Islands", + "code": "PN", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": true, + "locality": false, + "school_district": false + } + }, + { + "name": "Poland", + "code": "PL", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Portugal", + "code": "PT", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Puerto Rico", + "code": "PR", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": true, + "locality": false, + "school_district": false + } + }, + { + "name": "Qatar", + "code": "QA", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "R\u00e9union", + "code": "RE", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Romania", + "code": "RO", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Russia", + "code": "RU", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Rwanda", + "code": "RW", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Samoa", + "code": "WS", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "San Marino", + "code": "SM", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "S\u00e3o Tom\u00e9 & Pr\u00edncipe", + "code": "ST", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Saudi Arabia", + "code": "SA", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Senegal", + "code": "SN", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Serbia", + "code": "RS", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Seychelles", + "code": "SC", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Sierra Leone", + "code": "SL", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Singapore", + "code": "SG", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Sint Maarten", + "code": "SX", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Slovakia", + "code": "SK", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": true, + "locality": true, + "school_district": false + } + }, + { + "name": "Slovenia", + "code": "SI", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": true, + "locality": true, + "school_district": false + } + }, + { + "name": "Solomon Islands", + "code": "SB", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Somalia", + "code": "SO", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "South Africa", + "code": "ZA", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "South Georgia & South Sandwich Islands", + "code": "GS", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": true, + "locality": false, + "school_district": false + } + }, + { + "name": "South Korea", + "code": "KR", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "South Sudan", + "code": "SS", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Spain", + "code": "ES", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": true, + "locality": false, + "school_district": false + } + }, + { + "name": "Sri Lanka", + "code": "LK", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "St. Barth\u00e9lemy", + "code": "BL", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "St. Helena", + "code": "SH", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "St. Kitts & Nevis", + "code": "KN", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "St. Lucia", + "code": "LC", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "St. Martin", + "code": "MF", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": true, + "locality": false, + "school_district": false + } + }, + { + "name": "St. Pierre & Miquelon", + "code": "PM", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": true, + "locality": false, + "school_district": false + } + }, + { + "name": "St. Vincent & Grenadines", + "code": "VC", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Sudan", + "code": "SD", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Suriname", + "code": "SR", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Svalbard & Jan Mayen", + "code": "SJ", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Sweden", + "code": "SE", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Switzerland", + "code": "CH", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": true, + "locality": false, + "school_district": false + } + }, + { + "name": "Syria", + "code": "SY", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Taiwan", + "code": "TW", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Tajikistan", + "code": "TJ", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Tanzania", + "code": "TZ", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Thailand", + "code": "TH", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": true, + "locality": true, + "school_district": false + } + }, + { + "name": "Timor-Leste", + "code": "TL", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Togo", + "code": "TG", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Tokelau", + "code": "TK", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Tonga", + "code": "TO", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Trinidad & Tobago", + "code": "TT", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Tunisia", + "code": "TN", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "T\u00fcrkiye", + "code": "TR", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Turkmenistan", + "code": "TM", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Turks & Caicos Islands", + "code": "TC", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": true, + "locality": false, + "school_district": false + } + }, + { + "name": "Tuvalu", + "code": "TV", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "U.S. Outlying Islands", + "code": "UM", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "U.S. Virgin Islands", + "code": "VI", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Uganda", + "code": "UG", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Ukraine", + "code": "UA", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "United Arab Emirates", + "code": "AE", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "United Kingdom", + "code": "GB", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": true, + "school_district": false + } + }, + { + "name": "United States", + "code": "US", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": true, + "locality": true, + "school_district": true + } + }, + { + "name": "Uruguay", + "code": "UY", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Uzbekistan", + "code": "UZ", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Vanuatu", + "code": "VU", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Vatican City", + "code": "VA", + "feature": { + "country": true, + "administrative_area_level_1": false, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Venezuela", + "code": "VE", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": true, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Vietnam", + "code": "VN", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Wallis & Futuna", + "code": "WF", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Yemen", + "code": "YE", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Zambia", + "code": "ZM", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + }, + { + "name": "Zimbabwe", + "code": "ZW", + "feature": { + "country": true, + "administrative_area_level_1": true, + "administrative_area_level_2": false, + "postal_code": false, + "locality": false, + "school_district": false + } + } +] \ No newline at end of file diff --git a/samples/dds-region-viewer/style.css b/samples/dds-region-viewer/style.css new file mode 100644 index 00000000..0914c35c --- /dev/null +++ b/samples/dds-region-viewer/style.css @@ -0,0 +1,93 @@ +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +/* [START maps_dds_region_viewer] */ +/* + * Always set the map height explicitly to define the size of the div element + * that contains the map. + */ +gmp-map { + height: 100%; +} + +/* + * Optional: Makes the sample page fill the window. + */ +html, +body { + height: 100%; + margin: 0; + padding: 0; +} + +#container { + display: flex; + flex-direction: row; + height: 100%; + font-family: Roboto; + font-size: 14px; +} + +#sidebar { + background-color: #fff; + border-radius: 5px; + margin: 1rem; + padding: 5px; + flex-basis: 15rem; + flex-grow: 1; + box-sizing: border-box; + overflow: auto; + display: table; +} + +#title { + color: #fff; + background-color: #4d90fe; + font-size: 22px; + font-weight: 500; + padding: 6px 12px; + border-radius: 5px; +} + +gmp-place-autocomplete { + background-color: #fff; + border-radius: 5px; + margin-bottom: 10px; + font-family: Roboto, sans-serif; + font-size: large; + font-weight: bold; +} + +.pac-controls { + height: 32px; + border-radius: 5px; + margin-top: 10px; + width: -webkit-fill-available; +} + +#pac-content { + margin-top: 10px; +} + +#place-info { + font-size: 14px; +} + +#color-controls { + display: flex; + align-items: center; +} + +label { + display: flex; + align-items: center; + font-size: 14px; +} + +.unsupported-feature { + color: red; +} + +/* [END maps_dds_region_viewer] */ \ No newline at end of file diff --git a/samples/dds-region-viewer/tsconfig.json b/samples/dds-region-viewer/tsconfig.json new file mode 100644 index 00000000..17b70cdd --- /dev/null +++ b/samples/dds-region-viewer/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "module": "esnext", + "target": "esnext", + "strict": true, + "noImplicitAny": false, + "lib": [ + "es2015", + "esnext", + "es6", + "dom", + "dom.iterable" + ], + "moduleResolution": "Node", + "jsx": "preserve", + "resolveJsonModule": true, + } +}