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

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

Here is a very simple demo of this concept: https://dotnetfiddle.net/KhMIxV What you are going to want to do is make it so that your array in the controller can be translated to an array in javascript. This process is facilitated through serialization. The most common way (and one which should be available to your controller inherently) is through JSON.Net, ...


2

I got the solution. If you want, just do the following... //Styles to switch off the roads var stylez = [{ "featureType" : "road", "stylers" : [{ "visibility" : "off" } ] } ]; //Satellite var ghyb = new OpenLayers.Layer.Google( "Google Hybrid", { ...


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

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

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 ...


1

I ended up writing a Leaflet plugin, Leaflet.draw.topology, to accomplish this task. The only thing not implemented in the plugin is geometry validation, though in the future it certainly could be. It is currently handled server side with PostGIS.



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