Implement Web-based GIS with SVG technology

zhaozj2021-02-16  67

SVG (Scalable Vector Graphics) is an XML-based language-based language based on two-dimensional vector graphics and vector / dot matrix mixed graphics is a new vector graphics specification. The SVG specification defines the features, syntax, and display effects of SVG, including modular XML namespaces, and SVG Document Object Models (DOM). The drawing of SVG can be performed by dynamic and interactive manner, in actual operation, is implemented in an embedded manner or script. SVG not only provides hyperlink function, but also defines a wealth of events. Since the SVG supports scripting language (Script), you can programmatically, you can respond to specific events, thereby improving the dynamic and interaction performance of SVG by SCRIPT. SVG implements organic unity of graphics, images, and text. In addition to supporting commonly used tags in HTML, such as text, images, links, interactivity, CSS usage, script (Script), also provides a large number of specific tags for graphics, images, animations. This provides a possibility for achieving GIS.

Embed SVG in the web page

The browser-based GIS system will be implemented, and the SVG graphic object needs to be embedded in the web page, using the following HTML code to implement:

Where the Embed tag is specified as an embedded object, Width, Height specifies the width, height, TYPE specified type of the object, specified by the image / svg-xml, the SRC specifies the URL address of the SVG data file, specifies such a tag and in the browser Open, the browser calls with SVG Viewer in the specified area. Here, SRC specifies a SVG file, in the GIS system, requires different data according to different requests, can be changed to dynamic URLs, such as the server's Java servlet, dynamically generated by the server. It should be noted that SVG does not currently support GB coding, use the Chinese characters, please use UTF-8 encoding.

转载请注明原文地址:https://www.9cbs.com/read-16512.html

New Post(0)