✨ 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
58 lines
1.8 KiB
TypeScript
58 lines
1.8 KiB
TypeScript
import type {CodeKeywordDefinition} from "../../types"
|
|
import {KeywordCxt} from "../../compile/validate"
|
|
import {propertyInData, allSchemaProperties} from "../code"
|
|
import {alwaysValidSchema, toHash, mergeEvaluated} from "../../compile/util"
|
|
import apDef from "./additionalProperties"
|
|
|
|
const def: CodeKeywordDefinition = {
|
|
keyword: "properties",
|
|
type: "object",
|
|
schemaType: "object",
|
|
code(cxt: KeywordCxt) {
|
|
const {gen, schema, parentSchema, data, it} = cxt
|
|
if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === undefined) {
|
|
apDef.code(new KeywordCxt(it, apDef, "additionalProperties"))
|
|
}
|
|
const allProps = allSchemaProperties(schema)
|
|
for (const prop of allProps) {
|
|
it.definedProperties.add(prop)
|
|
}
|
|
if (it.opts.unevaluated && allProps.length && it.props !== true) {
|
|
it.props = mergeEvaluated.props(gen, toHash(allProps), it.props)
|
|
}
|
|
const properties = allProps.filter((p) => !alwaysValidSchema(it, schema[p]))
|
|
if (properties.length === 0) return
|
|
const valid = gen.name("valid")
|
|
|
|
for (const prop of properties) {
|
|
if (hasDefault(prop)) {
|
|
applyPropertySchema(prop)
|
|
} else {
|
|
gen.if(propertyInData(gen, data, prop, it.opts.ownProperties))
|
|
applyPropertySchema(prop)
|
|
if (!it.allErrors) gen.else().var(valid, true)
|
|
gen.endIf()
|
|
}
|
|
cxt.it.definedProperties.add(prop)
|
|
cxt.ok(valid)
|
|
}
|
|
|
|
function hasDefault(prop: string): boolean | undefined {
|
|
return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined
|
|
}
|
|
|
|
function applyPropertySchema(prop: string): void {
|
|
cxt.subschema(
|
|
{
|
|
keyword: "properties",
|
|
schemaProp: prop,
|
|
dataProp: prop,
|
|
},
|
|
valid
|
|
)
|
|
}
|
|
},
|
|
}
|
|
|
|
export default def
|