Month: July 2015

Google Maps V3: 通过经纬度获取地址信息 Get address from Latitude and Longitude

In this article I will explain how to get the address location from Latitude and Longitude using the Google Maps Geocoding API. I will explain two different ways of using the process of Reverse Geocoding using the Google Maps Geocoding API. Direct Usage Here I’ll pass the value of Latitude and Longitude directly from TextBoxes to the Google

谷歌无地图地址自动完成Google Places AutoComplete example without using Maps

In this article I will explain with an example, how to implement the Google Places Autocomplete without using Google Maps. In addition to this article will also explain how to use the Place changed event handler of the Google Autocomplete TextBox to get the selected place, its address and its location coordinates i.e. Latitude and Longitude. Implementing…

谷歌地图标记切换 Move Google Maps Markers: Change (Update) Marker position on Google Maps without refreshing

In this article I will explain how to move a marker to different locations on Google Maps i.e. How to change (update) position of a marker on Google Maps without refreshing the map. Move Google Maps Markers: Change (Update) Marker position on Google Maps without refreshing The following code snippet consists of an array of markers of

嵌入谷歌文档 Embed Google Doc Viewer: Display Google Drive Documents, SpreadSheets, PDF and Slides in Web page

Here Mudassar Ahmed Khan has explained how to embed Google Docs Viewer and display Google Drive files such as Word document (.doc, .docx), Excel Spreadsheet (.xls, .xlsx), PowerPoint presentation slides (ppt, .pptx) files and PDF documents (*.pdf) in your website’s web page. In this article I will explain how to embed Google Docs Viewer and display

jquery:颜色拾取器 Tiny Colorpicker

What is it? Tiny Colorpicker is a crossbrowser jquery plugin that creates a color picker (form) input. Its a easy way to add color pickers to your forms or user interface. Features IOS and Android support. AMD, Node, requirejs and commonjs support. Easy customizable Can be used inside forms or outside Lightweight Source is on GitHub 用法: $(document).ready(… Read More

jquery:圆形slider show – Tiny Circleslider – A lightweight cross browser circular carousel

What is it? Tinycircleslider is a circular slider / carousel. That was built to provide webdevelopers with a cool but subtle alternative to all those standard carousels. Tiny Circleslider can blend in on any wepage. It was built using the javascript jQuery library. Features IOS and Android support. AMD, Node, requirejs and commonjs support. Supports sli… Read More

jquery: 手机版时间拾取器 date time picker for mobile

Pickers There are three picker files: picker.js The core file (required before any other picker) picker.date.js The date picker picker.time.js The time picker To support old browsers, namely IE8, also include the legacy.js file. Themes All themes are generated using LESS and compiled from the lib/themes-source folder into the lib/themes folder. Ther… Read More

Mysql: LBS实现查找附近的人 (两经纬度之间的距离)

1. 利用GeoHash封装成内置数据库函数的简易方案; A:Mysql 内置函数方案,适合于已有业务,新增加LBS功能,增加经纬度字段方可,避免数据迁移 B:Mongodb 内置函数方案,适合中小型应用,快速实现LBS功能,性能优于A(推荐) 方案A: (MySQL Spatial) 1、先简历一张表:(MySQL 5.0 以上 仅支持 MyISAM 引擎) CREATE TABLE address ( address CHAR(80) NOT NULL, address_loc POINT NOT NULL, PRIMARY KEY(address) ); 空间索引: ALTER TABLE address ADD SPATIAL INDEX(address_… Read More

Swift中文教程(十七) 可选链

可选链(Optional Chaining)是一种可以请求和调用属性、方法及子脚本的过程,它的自判断性体现于请求或调用的目标当前可能为空(nil)。如果自判断的目标有值,那么调用就会成功;相反,如果选择的目标为空(nil),则这种调用将返回空(nil)。多次请求或调用可以被链接在一起形成一个链,如果任何一个节点为空(nil)将导致整个链失效。   注意: Swift 的自判断链和 Objective-C 中的消息为空有些相像,但是 Swift 可以使用在任意类型中,并且失败与否可以被检测到。   可选链可替代强制解析   通过在想调用的属性、方法、或子脚本的可选值(optional valu… Read More

Swift中文教程(十六) 自动引用计数

Swift使用自动引用计数(ARC)来管理应用程序的内存使用。这表示内存管理已经是Swift的一部分,在大多数情况下,你并不需要考虑内存的管理。当实例并不再被需要时,ARC会自动释放这些实例所使用的内存。   但是,少数情况下,你必须提供部分代码的额外信息给ARC,这样它才能够帮你管理这部分内存。本章阐述了这些情况并且展示如何使用ARC来管理应用程序的内存。   注意 引用计数仅仅作用于类实例上。结构和枚举是值类型,而非引用类型,所以不能被引用存储和传递。   1、ARC怎样工作 每当你创建一个类的实例,ARC分配一个内存块来存储这个实例的信息,包含了类型信息和实例的属性值信息。… Read More

Swift中文教程(十五) 析构

在一个类的实例被释放之前,析构函数会被调用。用关键字deinit来定义析构函数,类似于初始化函数用init来定义。析构函数只适用于class类型。   1、析构过程原理 Swift 会自动释放不再需要的实例以释放资源。如自动引用计数那一章描述,Swift 通过自动引用计数(ARC)处理实例的内存管理。通常当你的实例被释放时不需要手动地去清理。但是,当使用自己的资源时,你可能需要进行一些额外的清理。 例如,如果创建了一个自定义的类来打开一个文件,并写入一些数据,你可能需要在类实例被释放之前关闭该文件。   在类的定义中,每个类最多只能有一个析构函数。析构函数不带任何参数,在写法上不带括号: J… Read More

Swift中文教程(十四) 初始化

初始化是类,结构体和枚举类型实例化的准备阶段。这个阶段设置这个实例存储的属性的初始化数值和做一些使用实例之前的准备以及必须要做的其他一些设置工作。   通过定义构造器(initializers)实现这个实例化过程,也就是创建一个新的具体实例的特殊方法。和Objective-C不一样的是,Swift的构造器没有返回值。它们主要充当的角色是确保这个实例在使用之前能正确的初始化。   类实例也能实现一个析构器(deinitializer),在类实例销毁之前做一些清理工作。更多的关于析构器(deinitializer)的内容可以参考Deinitialization。    … Read More

Web 开发中 20 个很有用的 CSS 库

在过去的几年中,CSS已经成为一大部分开发者和设计者的最爱,因为它提供了一系列功能和特性。每个月都有无数个围绕CSS的工具被开发者发布以简化WEB开发。像CSS 库,框架,应用这样的工具能够为开发者做很多事,而且可以使开发者创造出创新立异的WEB应用。   在这篇文件章中我们找到了一系列对开发者有用的CSS库,它们能帮助开发者在一定的期限内取得有创造性和创新性的成果。我们希望这个列表能有助于您的开发并为您提供方便。尽情享受吧!   1. Kite Kite是一个灵活的布局助手CSS库。Kite使用`inline-block`而不是最新的CSS语法。它注重实际,易于理解且容易使用。Kite… Read More