Chat2Map: A ReAct-based Agent Framework for Automated Web Map Generation from Natural Language Instructions
Keywords: Large Language Models, WebGIS, Geospatial Visualization, ReAct Agent, Code Generation
Abstract. Web map creation remains difficult for non-specialists because it requires the combined use of geospatial data understanding, cartographic design, front-end development, and platform-specific mapping APIs. Although large language models have recently improved natural-language-driven code generation, they still perform unreliably in web mapping tasks, where failures often arise from hallucinated API usage, heterogeneous input data structures, and the gap between code plausibility and rendered map quality. This paper presents Chat2Map, an agent framework for automated web map generation from natural-language instructions. Rather than treating the task as one-shot text-to-code generation, Chat2Map formulates web map authoring as a grounded workflow that integrates skill and tool grounding, runtime schema construction for uploaded GeoJSON and JSON files, and an iterative generate-execute- diagnose-repair loop based on runtime and visual feedback. To validate the framework, we implemented a working prototype with Tianditu as a reference API setting and evaluated it on 30 web map generation tasks covering both directive-based generation and data-driven visualization. The results show that Chat2Map achieved 80% code executability and a 70% task success rate on directive-based tasks, while also maintaining a 70% task success rate on data-driven tasks where baseline models failed to produce usable outputs. These findings suggest that reliable web map generation depends not only on stronger code models, but also on how model reasoning is connected to domain knowledge, explicit data understanding, and real execution environments.
