html5_05 svg extension, geo-location, drag-and-drop

Source: Internet
Author: User
Tags polyline

1, SVG drawing summary:
① method One: SVG file already available,
Method Two:<body><svg></svg></body>
② Draw Rectangle: <rect x= "" y= "" width= "" height= "" ></rect>
③ Draw Circle: <circle cx= "" cy= "" r= "" ></circle>
④ Draw ellipse: <ellipse cx= "" cy= "" rx= "" ry= "" ></ellipse>
⑤ Draw line: <line x1= "" y1= "" x2= "" y2= "" ></line>
⑥ Draw polyline: <polyline points= "x1,y1 x2,y2 ..." ></polyline>
⑦ drawing polygons: <polygon points= "x1,y1 x2,y2 ..." ></polygon>
⑧ drawing text: <text x= "" y= "" font-size= "" >XXX</text>
⑨ drawing Image: <image xlink:href= "" ></image>
⑩ using gradients:
LinearGradient: linear gradient;
<svg>
<defs>
<lineargradient id= "G1" x1= "" y1= "" x2= "" y2= "" >
<stop offset= "0" stop-color= "stop-opacity=" ">
</linearGradient>
</defs>
<rect fill= "url (#g1)" stroke= "url (#g1)" ></rect>
</svg>
2. SVG filter (Filter)--pixel processing of the image:
Fegaussianblur: Gaussian blur filter;
<defs>
<filter id= "F1" >
<fegaussianblur stddeviation= "5" ></feGaussianBlur>
</filter>
<rect filter= "url (#f1)" ></rect>
</defs>
3. Third-party drawing tool Library--two.js:
<div id= "Container" ></div>
<script src= "Js/two.js" ></script>
<script>
var two=new ({}). AppendTo (container);
Two.makecircle (...);
Two.makerectangle (...);
Two.update ();
Two.play ();
</script>
4, HTML5 new features--geo-positioning:
①window.navigator.geolocation: Get the current location of your browser;
Longitude--longitude; dimension--latitude; elevation--altitude; speed--speed;
② mobile phone using built-in GPS module or signal base station, the PC uses IP address reverse resolution;
③ Browser geo-location involves personal privacy, asking permission:
navigator.geolocation{
getcurrentposition:fn,//Get location information once
watchposition:fn,//periodic monitoring of location information
clearwatch:fn//clearing the location monitor
}
④ using:
Navigator.geolocation.getCurrentPosition (
Function (POS) {//Get successful
Console.log (pos.coords.longtude);//Longitude
Console.log (pos.coords.latitude);//Dimension
Console.log (pos.coords.altitude);//elevation
Console.log (pos.coords.speed);//Speed
}
function (ERR) {//Get failed
Console.log (Err.code);
Console.log (Err.message);
}
);
5, call Baidu Map API:
View using JS call Baidu Map Description document--http://lbsyun.baidu.com/index.php?title=jspopular
6. New HTML feature-drag-and-Drop API (Drag & Drop):
① the object that is being dragged-the source object, which triggers the event:
ondragstart--drag to start; ondrag--drag; ondragend--drag to end;
② can drag an object that enters and lets go--the target object, which triggers the event:
ondragenter--dragged into the top, ondragover--dragged above hover; ondrop--loosened; ondragleave--dragged away;
③ondragover events Follow the default behavior is OnDragLeave, that is, ondragover after the default trigger OnDragLeave, the use of the browser should be blocked this default behavior;

html5_05 svg extension, geo-location, drag-and-drop

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.