Tag Info

Hot answers tagged

4

The OpenLayers.Control documentation says: Controls by default are added to the map they are contained within however it is possible to add a control to an external div by passing the div in the options parameter. So you just need to pass the div to the control while initialising it, somewhat like this: var mp=new ...


4

If you use custom objects and properties in your GeoJSON, they are ignored when the object is read using GeoJSON format. You can clearly see this on line 115 of the GeoJSON.js source code. Since the properties are never read in the first place, it is not possible to get them in OpenLayers. There are multiple workarounds to get what you want. You could ...


2

The idea to transfer vector data instead of images and render it on the client side is not new. There are already a lot of tools/projects doing that. See for example this plugin of leaflet, polymap, and also the cartagen project. OpenLayer developer are trying to introduce it in the (long-awaited) version 3.0. Each of these initiatives use their own vector ...


2

when you add a point with new OpenLayers.Control.DrawFeature(wfs, OpenLayers.Handler.Point), by default feature state set to "Insert" but when you add a point with vectorLayer.addFeatures() command, the feature state is null. when OpenLayers wants to save change, it see to the state of the feature, and you have to set the added feature state to ...


2

I use GeoServer in OpenGeo Suite 4.1. In this package, the "Service access rules list" page has a rule that only "ADMIN" roles have permission for WFS-Transaction. wfs.Transation --> ADMIN You must delete this rule.


1

You could use a style with a context : var monstyle = new OpenLayers.Style({ 'fillOpacity': 0, 'strokeColor': "red", 'strokeWidth': 0.8, 'label': "${getLabel}", 'fontFamily': "Verdana", 'fontWeight': "bold", 'fontSize': "7px", 'labelOutlineColor': "white", 'labelOutlineWidth': 1 }, { context: { getLabel: ...


1

I don't understand why are you using both libraries, you should choose one - Leaflet or OpenLayers and work with that one. This code isn't working because you didn't defined Leaflet map: map = L.map('map'); You defined OpenLayers map as map and in this line geojsonLayer.addTo(map); you're adding leaflet layer to leaflet map (map) but it can't find ...


1

Problem solved : 'url' is located in the 'options' field of vectorProtocol $radio.onclick = function() { vectorProtocol.options.url = "/getouterdata"; refreshLayer.refresh({force: true}); });


1

The OpenStreetMap tiles are pre-rendered in Web-Mercator (i.e. EPSG:3857) and hence you can't get them in your projection, and show it in this map. You have two options: Tile your data in Web Mercator Download OSM data, and then create tiles for it your Projection.


1

In server side convert json type to array.


1

Jakub Kania was correct in his comment that the date/time have to be added to the url to make it different from the url of tiles in the cache. You have to subclass OpenLayers.Layer.XYZ for that: OpenLayers.Layer.CustomXYZ = OpenLayers.Class(OpenLayers.Layer.XYZ, { getURL: function () { var url = OpenLayers.Layer.XYZ.prototype.getURL.apply(this, ...


1

Ok, just found the problem : I forgot the parameter "name" in my Vector constructor... My bad


1

For the map div sive you can use the getSize() function that returns a openLayers.Size instance that have width and height properties see: http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/files/OpenLayers/Map-js.html#OpenLayers.Map.getSize map = new.OpenLayers.Map('map'); size = map.getSize() width = size.w height = size.h


1

In your code, you are setting isBaseLayer: false; This will make the layer an overlay layer. If you want it as a base layer, then you just need to set it to true, i.e. isBaseLayer: true


1

Since QGIS 2.4, it is in the "Web" submenu. It was a kind of design decision to move the plugins from the plugin submenu to Raster/Vector/Web submenus.


1

I write this html script for you from this formule, x and y are taken from your example. Edit : This code was written for your previous question in which you are looking for a javascript code (This question has been deleted). I'm sorry if I'm off topic and I hope this code will help you anyway. <!DOCTYPE html> <html> <head> ...


1

Simply parse your shp file into geoJSON and parse it to a vectorlayer Look here: https://github.com/wavded/js-shapefile-to-geojson


1

I've modified the provided script as follows (imagecopymerge_alpha function). It seems to be working but I keep looking for a better way to handle transparency. <?php $TEMP_DIR = dirname(__FILE__) . '/tmp'; $TEMP_URL = '/tmp'; function imagecopymerge_alpha($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $opacity){ $w = ...



Only top voted, non community-wiki answers of a minimum length are eligible