This is a simple web project using Bootstrap 5.
- Replace
YOUR_API_KEY_HEREinjs/script.jsandheatmap.htmlwith your actual Vietmap API key. - Make sure the
data/VN34City.geojsonfiles are present in thedatadirectory.
index.html: Main HTML filecss/style.css: Custom stylesjs/script.js: Custom scripts
You can run this project in two ways:
- Using VS Code Task:
- Press
Cmd+Shift+P(macOS) orCtrl+Shift+P(Windows/Linux). - Type "Run Task" and select it.
- Choose "Run Server" to start the local server.
- Choose "Open in Browser" to view the main map.
- Choose "Open Heatmap in Browser" to view the heatmap.
- Press
- Administrative Map: Displays Vietnam's administrative boundaries with random colors and tooltips.
- Heatmap: Visualizes data density using a heatmap layer (see
heatmap.html).
You can control the polygon textures that appear on the boundaries map by adding a fillPattern property to your mapping JSON files (for example, mapping/province_by_id.json or mapping/ward_by_id.json). Accepted values are dot and hatch.
{
"01": {
"name_with_type": "Thành phố Hà Nội",
"slug": "ha-noi",
"ispeed": {
"download": 320,
"upload": 150,
"ping": 8,
"jitter": 2
},
"fillPattern": "hatch"
}
}The pattern layer sits on top of the existing color fill, so you can mix color-coded metrics with texture cues.