This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* o paramentro "municipio" é o codigo dele, que pode ser obtido em: | |
* https://servicodados.ibge.gov.br/api/docs/localidades?versao=1#api-bq | |
*/ | |
async function municipioSVG (municipio) { | |
const codEstado = municipio.toString().substring(0, 2) | |
const div = document.createElement('div') | |
const response = await fetch( | |
`https://servicodados.ibge.gov.br/api/v2/malhas/${codEstado}?resolucao=5&formato=image/svg+xml` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { icons } from 'feather-icons' | |
function Icon ({ icon }) { | |
this.svg = icons[icon].toSvg() | |
this.blob = new Blob([this.svg], { type: 'image/svg+xml' }) | |
this.src = URL.createObjectURL(this.blob) | |
return (<img src={this.src}></img>) | |
} |