---
title: "OpenLayers API和类来画点、线、面(Base)"
author: "hehch"
date: "2012-03-27T13:27:06Z"
tags: ["openlayers"]
categories: ["开源软件"]
slug: "openlayers-api-base"
draft: false
lastmod: "2012-03-27T13:27:06Z"
id: 1464910
url: "https://hehch.iteye.com/blog/1464910"
---

\[code="java"] 创建不同的Feature类实例 ———— 在电子地图上绘制Feature对象实例的方式有两种，一种是使用默认方式（但在相应的CSS表中也可以更换图片），另一种是自己做图片，并根据用户选择来响应在电子地图上创建的不同Feature类实例请求

# OpenLayers Draw Feature Example

在电子地图上创建点(Point)、线（line,在OpenLayers中的具体方法是OpenLayers.Handler.Path中的Path内置方法，Path方法实际上执行一个函数），面（Ploygon多面形）的例子。

- navigate
- draw point
- draw line
- draw polygon

\[/code]