Home > Web Front-end > JS Tutorial > body text

JavaScript implements map drag function SpryMap

高洛峰
Release: 2016-11-25 13:36:27
Original
1633 people have browsed it

SpryMap is an independent and lightweight JavaScript library that does not depend on any other JS framework. Using it, you can easily achieve dragging effects similar to Google and Baidu maps. SpryMap is perfect for displaying large images. SpryMap is also highly customizable. You can set the starting position of the image, CSS style, etc. through parameters. In addition, you can also set whether to use a smooth drag effect.
How to use

First load the SpryMap script file in the head

Add the content to be displayed on the page Pictures, such as setting the img tag with the id of worldMap

 Finally initialized when the page is loaded

var map = new SpryMap({id: "WorldMap",
Height: 400,
width: 800,
Startx: 200,
Starty: 200,
cssclass: "mappy"});


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!