Avalon.js Practice SVG Map Configuration Tool

Source: Internet
Author: User

The MVVM pattern, under a lot of complex interaction logic, has a great advantage. Now the relevant framework is also many, now the project uses the avalon.js, choose its reason, is the compatibility of consideration, of course, also to support the development of the domestic Daniel, as for performance, no actual test, dare not explain here.

Requirements: The first page of the project needs to display a map showing the number of classrooms deployed by the company in the area, the homepage can show the administrative center, the area name, add ★ focus on the city

Front Desk: page display uses the Raphael.js, the map information JS, converted into vml,svg (Baidu's Echart map is also good, but it does not have the county below the data, not adopted)

Question: Art sister out of all SVG pictures, how to convert SVG images into the necessary map information JS, became a problem. Art mm, but not JS. If you let the front end according to SVG collation, manual comparison of Trouble, the tool produced a

Design: JS file is mainly stored in the map information (

Originally designed to preserve the provincial and municipal level relations, provinces and cities have no use of the presentation form, resulting in a stronger coupling, expansion is more troublesome. Map information is present in a JS file, the first page loading is too slow.

Now designed to not care about provincial and municipal relations, can be configured, so that the configuration personnel want what look like. Each level of the map is returned by request, by returning which map has a map to determine whether it can enter the map or jump to the page.

Map configuration, Poke here. For demonstration convenience, the upload SVG file was changed to HTML5 file read, SVG file IE8 also not supported, so please ie10+, see the effect

Here is the map effect shown under configure, online address stamp here. The file is slightly larger, please wait patiently.

Operating instructions:

The left is the original SVG diagram, and the right is done in real time

Red dot for user drag custom, Admin center or ★ Config

Blue Squares for users to drag and drop the custom, adjust the text display position (by default, displayed above the administrative center)

Click on the SVG path or polygon image to configure the map area block (you can select a color value; You can configure multiple blocks to one region, a single region by default, and the original region by configuring the same region; can be configured to exist in the classroom, highlighted)

Click the SVG circle image to configure the Map Administration Center

  

Avalon.js Practice SVG Map Configuration Tool

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.