Tag Info

Hot answers tagged

12

If you are interested in an implementation look at jsts a Javascript implementation of the much used Java Topology Suite library -- depending on whether you prefer reading Javascript or Java, I suppose. A general idea of how the algorithm works. For points, it is trivial, you simply buffer them by a given radius. If you have multiple points, you will have ...


2

You will need to add a new interaction. Assuming that... this.mapRaster = ol.Map This should work this.mapRaster.on('singleclick',function(e){ var iconFeature = new ol.Feature({ geometry: new ol.geom.Point(e.coordinate), }); iconFeature.setStyle(_self.iconStyle); _self.rasterVectorSource.addFeatures([iconFeature]); Make the ...


2

First, when working with CMV, you should start with the unminified versions of the configuration files that will make it much easier to work with. The latest release is here. With respect to your question, you can use a function to create the popup template. Here's an reformatted example of your code reusing the same template for 3 different sublayers - 2 ...


2

I'm not familiar with CMV, there are a few JavaScript mistakes in your code if that's the exact code you're using. Firstly, you cannot use a variable (myArray[i]) as a name for JSON object key. Please see this tutorial and this reference. You should've gotten an error for this, I would've guessed... Secondly, you cannot put Dojo's define in a loop. You ...


2

http://jsfiddle.net/a6pp9vwz/9/ working for me. Console log said "$ not defined". $ is a jQuery class, so you need a jQuery environment to enable AJAX requests. You can enable jQuery in JSFiddle in the "Frameworks & Extensions" tab.


2

If I am understanding you correctly, you've copied the esri.css file from the js.arcgis.com server to your local server. This won't work because that esri.css file references images and possibly other resources on the js.arcgis.com server. It references those relative to the location of the css file. The css file is on your server but those required images ...


1

Feature creation can be kind of tricky in OpenLayers 3. There aren't any official examples for ol.source.Vector layers, most of them are working with GeoJSON, or some other data exchange format. I have managed to create a working fiddle. Let me explain some of the key aspects of achieving your task. var layerLines = new ol.layer.Vector({ source: new ...


1

After searching a little deeper, I just remembered that vector layer in OL is drawn on canvas. So it's easier to work with since HTML5 canvas has the 'color-blend' property called globalCompositeOperation. //First get the DOM Element of the layer var div = document.getElementById(buffer_layer.id); //Then get the canvas element; //it returns an array, so ...


1

You can't turn the layers in a layer group on and off independently. If your client needs to turn layers off then you need to request them separately in OpenLayers.


1

You can get this from the FeatureLayer class. There is an attribute called fields, which is an array of Field objects. The Field class has domain attribute. The following will output the domains in the console (if any): var fl = new FeatureLayer(...); for (var i = 0; i < fl.fields.length; i++) { console.debug(fl.fields[i].domain); } Good luck!


1

For future seekers of ol knowledge, I found the answer using the SelectControl control, which has a hash of attributes including two booleans that were pertinent to my problem: 'box' and 'multiple'. The docs are here: http://dev.openlayers.org/releases/OpenLayers2.10/doc/apidocs/files/OpenLayers/Control/SelectFeature-js.html#OpenLayers.Control.SelectFeature ...


1

Try parsing the JSON like this: var json = { "st_asgeojson": { "type":"LineString", "coordinates":[ [23.4582348,37.5062675], [23.4577141,37.5066109], [23.4572601,37.5070038], [23.4566746,37.507301], [23.455698,37.5076256], [23.4549737,37.5079214], ...


1

You can save your marker positions , your current map view coordinates etc.. into the localstorage of the browser . Localstorage is supported by nearly all modern browsers , you can check availability of local storage here .


1

Found the solution. The problem highlightFeature function with display whole info.update(layer.feature.properties) aka info0, info1, info2... so I need to write a specific highlightFeature for each layer like that : function highlightFeature0(e) { var layer = e.target; layer.setStyle({ weight: 3, color: '#666', dashArray: '', fillOpacity: 0.5, ...


1

No, if you are loading leaflet tile layers, it is not possible to change their style once loaded. The key difference between your code and the example code you linked to is that the example code renders geoJSON data directly in the browser. Notice this line of code: var featureLayer = new L.GeoJSON(); //... map.addLayer(featureLayer); You are loading ...


1

There are always multiple ways to skin this configurable cat. ;) I can think at least three approaches: Assuming you want your content at the bottom of the left sidebar, you can do this today in config/viewer: panes: { left: {}, myContent: { id: 'myContent', placeAt: 'left', region: 'bottom', style: 'height: 220px ...


1

The docs are great, look at the LayerGroup part. There is a method eachLayer that does exactly what you want: featureLayer.eachLayer(function (layer) { // do something with marker layer // layer.feature is probably defined, to create marker, do something like this layer.bindPopup(createPopupContentFromFeature(layer.feature)); }); You can do similar ...


1

In my MPSuperShape product, it is possible to apply a buffer to a convex polygon. This is performed by moving the vertices outwards on the line that bisects the two edges at that vertex. The distance is chosen using trigonometry so that the edges both move out a user-specified distance. This works well but acute vertices can extend disproportionately. Ie. ...


1

From the Leaflet Polygon examples, here is one way with a Switch Statement: var states = [{ "type": "Feature", "properties": {"party": "Republican"}, "geometry": { "type": "Polygon", "coordinates": [[ [-104.05, 48.99], [-97.22, 48.98], [-96.58, 45.94], [-104.03, 45.94], [-104.05, 48.99] ]] } }, { "type": ...


1

I don't even think being able to extract the T and V, if possible, is gonna be reliable cross-browsers. Might just be a browser interpretation thing. In any case, if you have access to it, I would just add your own attribute when you're creating the layer: var foo_layer = new ol.layer.Vector(...); foo_layer.layer_type = 'vector'; Then you can use it later ...


1

Until somebody finds a better solution, here what I would do ... As you noticed, leaflet is using pixel position to set zIndex (in Marker.js) pos = this._map._latLngToNewLayerPoint(this._latlng, opt.zoom, opt.center).round(); this._zIndex = pos.y + this.options.zIndexOffset; What I suggest is to undo leaflet zIndex using setZIndexOffset() Say you want ...



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