Carregando mapas...

Selecione um mapa

Escolha um mapa na lista acima para visualizá-lo.

// Event listeners do modal document.addEventListener('click', function(event) { const modal = document.getElementById('modalPdfs'); if (event.target === modal) { fecharModalPdfs(); } }); document.addEventListener('keydown', function(event) { if (event.key === 'Escape' && mapaAtualModal) { fecharModalPdfs(); } }); // Função para aplicar estilo otimizado às features do mapa function applyOptimizedMapStyle(feature, config, mapId) { // Esta função será chamada de forma síncrona, mas carregará cores de forma assíncrona const defaultStyle = { fillColor: '#FFEDA0', // Cor padrão se nenhuma cor personalizada for aplicada weight: 2, opacity: 1, color: 'white', dashArray: '3', fillOpacity: 0.7 }; // Aplicar configurações básicas de estilo if (config) { defaultStyle.fillOpacity = config.fillOpacity / 100 || 0.7; defaultStyle.color = config.strokeColor || 'white'; defaultStyle.weight = config.strokeWidth || 2; defaultStyle.opacity = config.strokeOpacity / 100 || 1; } // Se não houver atributo de coloração, usar estilo padrão if (!config || !config.color_attribute) { return defaultStyle; } const attributeValue = feature.properties[config.color_attribute]; // Usar cores padrão baseadas em hash para consistência const coresPadrao = ['#FF6B6B', '#4ECDC4', '#45B7D1', '#96CEB4', '#FFEAA7', '#DDA0DD', '#98D8C8', '#F7DC6F']; const hash = attributeValue ? attributeValue.toString().split('').reduce((a, b) => { a = ((a << 5) - a) + b.charCodeAt(0); return a & a; }, 0) : 0; const fillColor = coresPadrao[Math.abs(hash) % coresPadrao.length]; return { ...defaultStyle, fillColor: fillColor }; }