当前位置: 首页>>代码示例>>Java>>正文


Java JSObject类代码示例

本文整理汇总了Java中org.gwtopenmaps.openlayers.client.util.JSObject的典型用法代码示例。如果您正苦于以下问题:Java JSObject类的具体用法?Java JSObject怎么用?Java JSObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


JSObject类属于org.gwtopenmaps.openlayers.client.util包,在下文中一共展示了JSObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMyUrl

import org.gwtopenmaps.openlayers.client.util.JSObject; //导入依赖的package包/类
private static native JSObject getMyUrl() /*-{
	function get_my_url(bounds) {
		var res = this.map.getResolution();
		var x = Math.round((bounds.left - this.maxExtent.left)
				/ (res * this.tileSize.w));
		var y = Math.round((this.maxExtent.top - bounds.top)
				/ (res * this.tileSize.h));
		var z = this.map.getZoom();
		var limit = Math.pow(2, z);
		if (y < 0 || y >= limit) {
			return null;
		} else {
			x = ((x % limit) + limit) % limit;
			url = this.url;
			path = z + "/" + x + "/" + y + "." + this.type;
			if (url instanceof Array) {
				url = this.selectUrl(path, url);
			}
			return url + path;
		}
	}

	return get_my_url;
}-*/;
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:25,代码来源:TmsLayerDef.java

示例2: getColorStyleData

import org.gwtopenmaps.openlayers.client.util.JSObject; //导入依赖的package包/类
private void getColorStyleData(Style style) {
	if(style != null) {
		JSObject jsStyle = style.getJSObject();
		String fillColor = jsStyle.getPropertyAsString("userFillColor");			
		String strokeColor = jsStyle.getPropertyAsString("userStrokeColor");
		int thickness = (int) Math.floor(style.getStrokeWidth());
					
		/**
		 * Si estamos en modo de estilo por feature, hay que coger el color 
		 * de referencia de las propiedades userFillColor y userStrokeColor, 
		 * puesto que los features afectados están seleccionados y por tanto
		 * tienen asignado el color de relleno y linea del modo selección 
		 */
		getFill().setNormalColor(fillColor != null ? fillColor : style.getFillColor());
		getFill().setOpacity(style.getFillOpacity());
		getLine().setNormalColor(strokeColor != null ? strokeColor : style.getStrokeColor());
		getLine().setThickness(thickness);	
	}
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:20,代码来源:VectorFeatureStyleDef.java

示例3: getLabelStyleData

import org.gwtopenmaps.openlayers.client.util.JSObject; //导入依赖的package包/类
private void getLabelStyleData(Style style, VectorLayer layer) {
	if(style != null) {
		JSObject jsStyle = style.getJSObject();
		
		boolean enabled = jsStyle.getPropertyAsString("userAttributeLabel") != null 
				&& !jsStyle.getPropertyAsString("userAttributeLabel").isEmpty();			
				
		if(enabled) {
			getLabel().setAttribute(layer.getAttribute(
					jsStyle.getPropertyAsString("userAttributeLabel")));
										
			getLabel().setFontSize(getFontSize(jsStyle));
			getLabel().setBoldStyle(isBoldFont(jsStyle));
			getLabel().setBackgroundColor(jsStyle.getPropertyAsString("labelOutlineColor"));
		} 
	} 
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:18,代码来源:VectorFeatureStyleDef.java

示例4: applyColorStyle

import org.gwtopenmaps.openlayers.client.util.JSObject; //导入依赖的package包/类
private void applyColorStyle(Style style) {
	style.setFillColor(getFill().getNormalColor());
	style.setFillOpacity(getFill().getOpacity());
	style.setStrokeColor(getLine().getNormalColor());
	style.setStrokeWidth(getLine().getThickness());
	
	/**
	 * Se almacena el mismo color de relleno y linea en las propiedades
	 * userFillColor y userStrokeColor para tenerlo siempre disponible
	 * y asi poder aplicar los efectos de select y hover mediante eventos
	 * (ver VectorLayer.addFeatureSelectListeners())
	 */
	JSObject jsStyle = style.getJSObject();
	jsStyle.setProperty("userFillColor", getFill().getNormalColor());
	jsStyle.setProperty("userStrokeColor", getLine().getNormalColor());
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:17,代码来源:VectorFeatureStyleDef.java

示例5: read

import org.gwtopenmaps.openlayers.client.util.JSObject; //导入依赖的package包/类
public VectorFeature[] read(String vectorFormatString) {
	JSObject out = FormatImpl.read(getJSObject(), vectorFormatString);
	JObjectArray jObjectArray = JObjectArray.narrowToJObjectArray(out.ensureOpaqueArray());
	int nr = jObjectArray.length();
	VectorFeature[] vfs = new VectorFeature[nr];
	for (int i = 0; i < nr; i++) {

		VectorFeature vf = VectorFeature.narrowToVectorFeature(jObjectArray.get(i));

		JSObject styleObject = jObjectArray.get(i).getProperty(STYLE_NAME);
		if (styleObject != null) {
			VectorFeatureStyleDef def = getStyleDef(styleObject);
			vf.setStyle(def.toStyle(vf));
		}

		vfs[i] = vf;
	}

	return vfs;
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:21,代码来源:GeoJSONCSS.java

示例6: getStyle

import org.gwtopenmaps.openlayers.client.util.JSObject; //导入依赖的package包/类
public static JSObject getStyle(VectorStyleDef def) {

		String fillColor = def.getFill().getNormalColor();
		Double fillOpacity = def.getFill().getOpacity();
		String strokeColor = def.getLine().getNormalColor();
		Double strokeWidth = new Double(def.getLine().getThickness());
		
		JSObject styleObject = JSObject.createJSObject();
		styleObject.setProperty(FILL_NAME, true);
		styleObject.setProperty(FILL_COLOR_NAME, fillColor);
		styleObject.setProperty(FILL_OPACITY_NAME, fillOpacity);
		styleObject.setProperty(STROKE_COLOR_NAME, strokeColor);
		styleObject.setProperty(STROKE_WIDTH_NAME, strokeWidth);
		styleObject.setProperty(RADIUS_NAME, RADIUS_VALUE);
		
		
		//icon
		String iconUrl = def.getPoint().getExternalGraphic();
		if (iconUrl != null) {
			JSObject iconObject = JSObject.createJSObject();
			iconObject.setProperty(ICON_URL_NAME, iconUrl);
			JsArrayInteger iconSize = JSObject.createArray().cast();
			
			iconSize.push(def.getPoint().getGraphicWidth());
			iconSize.push(def.getPoint().getGraphicHeight());
			
			JSObject iconSizeObject = iconSize.cast();
			
			iconObject.setProperty(ICON_SIZE_NAME, iconSizeObject);	
			
			styleObject.setProperty(ICON_NAME, iconObject);
		}
						
		return styleObject;
	}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:36,代码来源:LeafletStyle.java

示例7: getFontSize

import org.gwtopenmaps.openlayers.client.util.JSObject; //导入依赖的package包/类
private Integer getFontSize(JSObject style) {		
	String fontSize = style.getPropertyAsString("fontSize");
	
	if(fontSize != null && !fontSize.isEmpty()) {
		fontSize = fontSize.substring(0, fontSize.lastIndexOf("px"));
		return Integer.parseInt(fontSize);					
	}
	return LabelStyle.DEFAULT_FONT_SIZE;
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:10,代码来源:VectorFeatureStyleDef.java

示例8: isBoldFont

import org.gwtopenmaps.openlayers.client.util.JSObject; //导入依赖的package包/类
private boolean isBoldFont(JSObject style) {
	String fontWeight = style.getPropertyAsString("fontWeight");
	
	if(fontWeight == null || fontWeight.isEmpty()) {
		fontWeight = "regular";
	}
	return fontWeight.equalsIgnoreCase("bold");
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:9,代码来源:VectorFeatureStyleDef.java

示例9: applyLabelStyle

import org.gwtopenmaps.openlayers.client.util.JSObject; //导入依赖的package包/类
private void applyLabelStyle(Style style, VectorFeature feature) {				
	JSObject jsStyle = style.getJSObject();
	
	if(getLabel().isEnabled()) {								
		style.setLabel(feature.getAttributes().getAttributeAsString(
				getLabel().getAttribute().getName()));
		style.setFontSize(getLabel().getFontSize() + "px");
			
		/**
		 * Se almacena el atributo de etiquetado en la propiedad
		 * userAttributeLabel para tenerlo disponible a la hora de
		 * recargar el dialogo de estilos
		 */
		jsStyle.setProperty("userAttributeLabel", 
				getLabel().getAttribute().getName());
		
		style.setFontWeight(getLabel().isBoldStyle() ? "bold" : "regular");					
		
		final boolean labelBackgroung = !getLabel()
				.getBackgroundColor().isEmpty();	
		
		jsStyle.setProperty("labelOutlineWidth", (labelBackgroung ? 10 : 0));
		jsStyle.setProperty("labelOutlineColor", (labelBackgroung ?
				getLabel().getBackgroundColor() : ""));			
	} else {
		style.setLabel(null);
		jsStyle.unsetProperty("userAttributeLabel");
	}
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:30,代码来源:VectorFeatureStyleDef.java

示例10: toStyleMap

import org.gwtopenmaps.openlayers.client.util.JSObject; //导入依赖的package包/类
public StyleMap toStyleMap() {
	String labelAttribute = getLabel().isEnabled() ? getLabel().getAttribute().getName() : null;
	String colorThemingAttribute = isColorThemingEnabled() ? getColorThemingAttribute().getName() : null;
	
	Style normalStyle = StyleFactory.createStyle(
			getLine().getNormalColor(), getLine().getThickness(),
			getFill().getNormalColor(), getFill().getOpacity(), 
			labelAttribute, colorThemingAttribute);

	Style selectedStyle = StyleFactory.createStyle(
			getLine().getSelectedColor(), getLine().getThickness(),
			getFill().getSelectedColor(), getFill().getOpacity(), 
			labelAttribute, null);

	Style hoverStyle = StyleFactory.createStyle(
			getLine().getHoverColor(), getLine().getThickness(),
			getFill().getHoverColor(), getFill().getOpacity(), 
			labelAttribute, null);			
			
	JSObject jsStyle = normalStyle.getJSObject().getProperty("defaultStyle");						
	
	if (getLabel().isEnabled()) {
		jsStyle.setProperty("fontSize", getLabel().getFontSize() + "px");
		jsStyle.setProperty("fontWeight", getLabel().isBoldStyle() ? "bold" : "regular");
		
		final boolean labelBackgroung = getLabel().getBackgroundColor() != null;				
		jsStyle.setProperty("labelOutlineWidth", (labelBackgroung ? 10 : 0));
		jsStyle.setProperty("labelOutlineColor", labelBackgroung ?
				getLabel().getBackgroundColor() : "");				
	} 
	
	jsStyle.setProperty("graphicName", getPoint().getVertexStyle().getStyleName());
	jsStyle.setProperty("externalGraphic", getPoint().getExternalGraphic());
	jsStyle.setProperty("graphicWidth", getPoint().getGraphicWidth());
	jsStyle.setProperty("graphicHeight", getPoint().getGraphicHeight());
				
	return new StyleMap(normalStyle, selectedStyle, hoverStyle);
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:39,代码来源:VectorStyleDef.java

示例11: getLayerStyle

import org.gwtopenmaps.openlayers.client.util.JSObject; //导入依赖的package包/类
public VectorStyleDef getLayerStyle(String vectorFormatString) {
	VectorFeatureStyleDef def = null;
	
	final JSONValue jsonValue = JSONParser.parseLenient(vectorFormatString);
	final JSONObject geoJSONCssObject = jsonValue.isObject();

	if (geoJSONCssObject.containsKey(GeoJSONCSS.STYLE_NAME)) {

		JSONObject styleObject = geoJSONCssObject.get(GeoJSONCSS.STYLE_NAME).isObject();
		JSObject styleJSObject = styleObject.getJavaScriptObject().cast();
		def = getStyleDef(styleJSObject);
	}

	return def;
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:16,代码来源:GeoJSONCSS.java

示例12: VectorLayer

import org.gwtopenmaps.openlayers.client.util.JSObject; //导入依赖的package包/类
public VectorLayer(JSObject vector) {
	super(vector);	
	
	this.featureSchema = new FeatureSchema();
	setVectorStyle(new VectorStyleDef());
	addFeatureAddedListener();
	addFeatureSelectListeners();
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:9,代码来源:VectorLayer.java

示例13: createFeatureAddedCallback

import org.gwtopenmaps.openlayers.client.util.JSObject; //导入依赖的package包/类
public static native JSObject createFeatureAddedCallback(FeatureAddedListener listener)/*-{
	var callback = function(obj){
		var vectorFeatureObj = @org.gwtopenmaps.openlayers.client.feature.VectorFeature::narrowToVectorFeature(Lorg/gwtopenmaps/openlayers/client/util/JSObject;)(obj);
		[email protected]ture.FeatureAddedListener::onFeatureAdded(Lorg/gwtopenmaps/openlayers/client/feature/VectorFeature;)(vectorFeatureObj);
	}
	return callback;
}-*/;
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:8,代码来源:DrawSingleFeatureImpl.java

示例14: getDefaultMapOptions

import org.gwtopenmaps.openlayers.client.util.JSObject; //导入依赖的package包/类
protected static MapOptions getDefaultMapOptions() {
    MapOptions mapOptions = new MapOptions();
    mapOptions.setProjection("CRS:84");
    mapOptions.setDisplayProjection(CRS84);
    mapOptions.removeDefaultControls();
    mapOptions.setControls(new JObjectArray(new JSObject[0]));
    JSObject vendorParams = JSObject.createJSObject();
    vendorParams.setProperty("theme", GWT.getModuleBaseURL() + "theme/default/style.css");
    mapOptions.setJSObject(vendorParams);
    return mapOptions;
}
 
开发者ID:Reading-eScience-Centre,项目名称:edal-java,代码行数:12,代码来源:MapArea.java

示例15: create

import org.gwtopenmaps.openlayers.client.util.JSObject; //导入依赖的package包/类
/**
 * Creates the.
 * 
 * @return the jS object
 */
public static native JSObject create()/*-{
                                      var control = new $wnd.OpenLayers.Control.ZoomIn();
                                      $wnd.OpenLayers.Util.extend(control, { 
                              				draw: function () {
                                      			this.box = new $wnd.OpenLayers.Handler.Box( control, 
                                      														{"done": this.notice},
                              	       														{keyMask: $wnd.OpenLayers.Handler.MOD_SHIFT});
                                      														this.box.activate();
                                  		}
                                      }); 
                                      return control;
                                      }-*/;
 
开发者ID:52North,项目名称:SensorWebClient,代码行数:18,代码来源:BBoxControlImpl.java


注:本文中的org.gwtopenmaps.openlayers.client.util.JSObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。