🎯 MapView v2.0 - Global Deployment Ready

 MAJOR FEATURES:
• Auto-zoom intelligence với smart bounds fitting
• Enhanced 3D GPS markers với pulsing effects
• Professional route display với 6-layer rendering
• Status-based parking icons với availability indicators
• Production-ready build optimizations

🗺️ AUTO-ZOOM FEATURES:
• Smart bounds fitting cho GPS + selected parking
• Adaptive padding (50px) cho visual balance
• Max zoom control (level 16) để tránh quá gần
• Dynamic centering khi không có selection

🎨 ENHANCED VISUALS:
• 3D GPS marker với multi-layer pulse effects
• Advanced parking icons với status colors
• Selection highlighting với animation
• Dimming system cho non-selected items

🛣️ ROUTE SYSTEM:
• OpenRouteService API integration
• Multi-layer route rendering (glow, shadow, main, animated)
• Real-time distance & duration calculation
• Visual route info trong popup

📱 PRODUCTION READY:
• SSR safe với dynamic imports
• Build errors resolved
• Global deployment via Vercel
• Optimized performance

🌍 DEPLOYMENT:
• Vercel: https://whatever-ctk2auuxr-phong12hexdockworks-projects.vercel.app
• Bundle size: 22.8 kB optimized
• Global CDN distribution
• HTTPS enabled

💾 VERSION CONTROL:
• MapView-v2.0.tsx backup created
• MAPVIEW_VERSIONS.md documentation
• Full version history tracking
This commit is contained in:
2025-07-20 19:52:16 +07:00
parent 3203463a6a
commit c65cc97a33
64624 changed files with 7199453 additions and 6462 deletions

View File

@@ -0,0 +1,59 @@
import Metadata from './metadata.js'
import matchesEntirely from './helpers/matchesEntirely.js'
import getNumberType from './helpers/getNumberType.js'
/**
* Checks if a given phone number is valid.
*
* isValid(phoneNumberInstance, { ..., v2: true }, metadata)
*
* isPossible({ phone: '8005553535', country: 'RU' }, { ... }, metadata)
* isPossible({ phone: '8005553535', country: 'RU' }, undefined, metadata)
*
* If the `number` is a string, it will be parsed to an object,
* but only if it contains only valid phone number characters (including punctuation).
* If the `number` is an object, it is used as is.
*
* The optional `defaultCountry` argument is the default country.
* I.e. it does not restrict to just that country,
* e.g. in those cases where several countries share
* the same phone numbering rules (NANPA, Britain, etc).
* For example, even though the number `07624 369230`
* belongs to the Isle of Man ("IM" country code)
* calling `isValidNumber('07624369230', 'GB', metadata)`
* still returns `true` because the country is not restricted to `GB`,
* it's just that `GB` is the default one for the phone numbering rules.
* For restricting the country see `isValidNumberForRegion()`
* though restricting a country might not be a good idea.
* https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion
*
* Examples:
*
* ```js
* isValidNumber('+78005553535', metadata)
* isValidNumber('8005553535', 'RU', metadata)
* isValidNumber('88005553535', 'RU', metadata)
* isValidNumber({ phone: '8005553535', country: 'RU' }, metadata)
* ```
*/
export default function isValidNumber(input, options, metadata)
{
// If assigning the `{}` default value is moved to the arguments above,
// code coverage would decrease for some weird reason.
options = options || {}
metadata = new Metadata(metadata)
metadata.selectNumberingPlan(input.country, input.countryCallingCode)
// By default, countries only have type regexps when it's required for
// distinguishing different countries having the same `countryCallingCode`.
if (metadata.hasTypes()) {
return getNumberType(input, options, metadata.metadata) !== undefined
}
// If there are no type regexps for this country in metadata then use
// `nationalNumberPattern` as a "better than nothing" replacement.
const nationalNumber = options.v2 ? input.nationalNumber : input.phone
return matchesEntirely(nationalNumber, metadata.nationalNumberPattern())
}