`

Maker-shadow

阅读更多

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%

String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

  <head>

    <base href="<%=basePath%>">

    

    <title>My JSP 'mark-shadow.jsp' starting page</title>

    

<meta http-equiv="pragma" content="no-cache">

<meta http-equiv="cache-control" content="no-cache">

<meta http-equiv="expires" content="0">    

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">

<meta http-equiv="description" content="This is my page">

<!--

<link rel="stylesheet" type="text/css" href="styles.css">

-->

<link rel="stylesheet" href="<%=basePath%>/Script/theme/default/style.css" type="text/css">

    <link rel="stylesheet" href="<%=basePath%>/Style/style.css" type="text/css">

<script src="<%=basePath%>/Script/lib/OpenLayers.js"></script>

<script type="text/javascript">

var SHADOW_Z_INDEX = 10;

        var MARKER_Z_INDEX = 11;

        var DIAMETER = 200;

        var NUMBER_OF_FEATURES = 15;

var map,layer;

function init(){

map  = new OpenLayers.Map('map');

var renderer = OpenLayers.Util.getParameters(window.location.href).renderer;

            renderer = (renderer) ? [renderer] : OpenLayers.Layer.Vector.prototype.renderers;

layer = new OpenLayers.Layer.Vector(

                "Marker Drop Shadows",

                {

                    styleMap: new OpenLayers.StyleMap({

                        // Set the external graphic and background graphic images.

                        externalGraphic: "<%=basePath%>Script/img/marker-gold.png",

                        backgroundGraphic: "<%=basePath%>Script/img/marker_shadow.png",

                        

                        // Makes sure the background graphic is placed correctly relative

                        // to the external graphic.

                        backgroundXOffset: 0,

                        backgroundYOffset: -7,

                        

                        // Set the z-indexes of both graphics to make sure the background

                        // graphics stay in the background (shadows on top of markers looks

                        // odd; let's not do that).

                        graphicZIndex: MARKER_Z_INDEX,

                        backgroundGraphicZIndex: SHADOW_Z_INDEX,

                        

                        pointRadius: 10

                    }),

                    isBaseLayer: true,

                    rendererOptions: {yOrdering: true},

                    renderers: renderer

                }

            );

            console.log('<%=basePath%>Script/img/marker-gold.png');

 

map.addLayers([layer]);

map.addControls([new OpenLayers.Control.LayerSwitcher(),new OpenLayers.Control.MousePosition()]);

map.zoomToMaxExtent();

layer.addFeatures(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(-37.96875,54.84375)));

}

</script>

  </head>

  

  <body onload="init();">

  <h3>这是我的第一个正式程序,终于自己写了一个程序了,真难,希望自己能渡过这个难关,最近压力很大</h3>

  <ul>

  <li>创建地图对象</li>

  <li>创建地图图层【设置扩展图和扩展图的背景图,设置图片相对位置】</li>

  <li>创建画布上的点point[程序执行顺序是1、创建地图 2、创建点 3、设置点的位置图]</li>

  </ul>

  <hr>

    <div id="map" class="smallmap"></div>

  </body>

</html>

 

分享到:
评论

相关推荐

    digital-maker-space:发布,创建和共享ccm组件和模块化应用程序的地方

    "Digital Maker Space" 是一个平台,专注于发布、创建和共享基于 CCM(Component Communication Mechanism)组件和模块化应用程序。这个平台鼓励创新和协作,旨在促进Web开发中的模块化思想和自定义元素的使用,从而...

    UIView Shadow Maker(iPhone源代码)

    来源:Licence:BSD平台:iOS设备:iPhone / iPad作者:Philip Yu  给任意UIView视图四条边框加上阴影,可以自定义阴影的颜色、粗细程度、透明程度以及位置(上下左右边框)。 例如,效果图的左边UIView是四周...

    实现怎样给视图边框加上阴影特效

    本教程将基于提供的"UIView-Shadow-Maker-master"源码,深入讲解如何自定义视图的阴影属性,包括颜色、边缘宽度和透明度,以创建出个性化的效果。 首先,我们需要了解iOS中视图阴影的基础知识。在UIKit框架中,`...

    wep使用方法

    - **Advanced Mode**:以更复杂的游戏为例,假设我们要修改名为“Shadow”的角色名称为“moon”。首先捕获到的数据包如下: - `SEND-&gt;0000081421060104` - `SEND-&gt;0000010699536861646F77000105` - `SEND-&gt;...

    10个很棒的 CSS3 开发工具 推荐

    3. CSS3 Drop Shadow Generator:这是一款生成CSS3阴影效果的工具,能自动生成对应的代码,让阴影效果的实现变得简单。你可以访问[CSS3 Drop Shadow Generator](未提供链接)进行体验。 4. Cascader:这个工具旨在...

Global site tag (gtag.js) - Google Analytics