Auxiliary Function util. js of openlayers (3)

Source: Internet
Author: User
Tags tagname transparent image

The util. js file contains auxiliary universal functions in the openlayers library.

Util. getelement Obtain an htmlelement, similar to the $ function in the prototype library. If window. $ does not exist, it is set to window. $ = getelement.
Util. iselement (o) Determines whether the specified o is an HTML element,Note: This method is not strictly implemented. nodetype can be disguised, such as VAR o = {nodetype: 1} and non-htmlelement.
Util. Extend (destination, source) Copy the property in the source object to the destination object.
Util. removeitem (array, item) It is called the item in the array.
Util. cleararray Clear array content
Util. indexof (array, OBJ) Returns the index value of OBJ in the array.
Util. modifydomelement (element, ID, PX, SZ, position, border, overflow, opacity) Modifies multiple attributes of a given element.
Util. creatediv (ID, PX, SZ, imgurl, position, border, overflow, opacity) Create a div element. If no ID is set, a uniqueid is automatically generated and its attributes are optional.
Util. createimage (ID, PX, SZ, imgurl, position, border, opacity, delaydisplay) Creates an image element. If no ID is set, a uniqueid is automatically generated and its attributes are optional.
Util. alphahack () Check whether the browser needs to hack the PNG Image
Util. modifyalphaimagediv (DIV, ID, PX, SZ, imgurl,
Position, border, sizing,
Opacity)
Modify the transparency attribute of a PNG Image and multiple attributes of the element Div.
Util. createalphaimagediv (ID, PX, SZ, imgurl,
Position, border, sizing,
Opacity, delaydisplay)
Create a div element with PNG transparent image
Util. uppercaseobject (object) Copy the object Value and create a new object. The key value is capitalized.
Util. getparameterstring (Params) Make Params in the form of key1 = value1 & key2 = value2 & key3 = value3
Util. urlappend (URL, paramstr) Append the paramstr parameter to the URL
Util. Try () Execute functions until one of them doesn't throw an error.
Util. getnodes (p, tagname) Obtain all the elements of the tagname tag in the P element.
Util. gettagtext (parent, item, index) Obtains the text value of a tag.
Util. getxmlnodevalue (node) The text value of the given node, without breaking in Firefox or IE
Util. tofloat (number, precision) Converts a number to a floating point with precision
Util. distvincenty (P1, P2) Calculate the distance between two points (spherical coordinates)
Util. getparameters (URL) Parse a URL parameter as a crpt object
Util. createuniqueid (prefix) Returns a unique ID string.
Util. getresolutionfromscale (scale, units) Obtain screen resolution based on Scale
Util. getscalefromresolution (resolution, units) Obtain the scale according to the screen resolution
Util. pageposition (forelement) Position of the computing element on the page
Util. removetail (forelement) Remove? From utl? And #
Util. getbrowsername () Current browser name
Util. getformattedlonlat (coordinate, axis, dmsoption) Format the longitude and latitude coordinates to degrees, minutes, and seconds.

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.