Tag Info

Hot answers tagged

3

There is nothing wrong with your GeoJSON. You just have to define the default projection and the destination projection in the source for on-the-fly projection. Also, there is no need to save the projection objects in variables, like ProjectionNL, you can use the EPSG code of any projection, after it has been defined by Proj4JS. Of course, you can change up ...


2

Try this: var iconStyle_line = new ol.style.Style({// My style definition fill: new ol.style.Fill({ color: 'rgba(221, 99, 0, 0.5)' }), stroke: new ol.style.Stroke({ color: 'rgba(221, 99, 0, 0.5)', width: 3, lineDash: [4,4] // <-Here is the change. first line then space. try [40,40] if not shown as dash }) ...


2

change the easy button function to: L.easyButton('fa-compass', function (){ $('.leaflet-routing-container').is(':visible') ? route.removeFrom(map) : route.addTo(map) }, 'Routing' ); This just applies a simple ternary operator to determine whether to add or remove the route control (and uses jQuery to detect the visibility of the routing ...


2

You're missing the # at the start of your jQuery id selector, line 119 in your jsfiddle, for your toggle-layers element. A neater solution might be to use the bindTo method between your source layer (vectorLayer) and target element (a checkbox). See http://openlayers.org/en/v3.1.1/examples/bind-input.html as an example


2

Reading through the answer to this question may help you: http://stackoverflow.com/questions/20601997/how-to-approach-converting-vbscript-to-python-code Break down the labeling script into its parts (variables, functions, etc.) and then write that in pseudo-code. Since you are not familiar with JavaScript syntax, the Esri Help is a good place to start: ...


2

You were doing it basically right, check this full example: http://bl.ocks.org/javierarce/50244a6a7a8a4e1a959a


2

For your first issue: it appears that the template file for your widget is missing, inaccessible or corrupt. Based on the code posted in the linked example, the template file is './Select/templates/Select.html'. Check that file to ensure it is valid. For your second issue: to do a simple average, you would take the sum calculated in the example code ...


2

In the map constructor options, set autoResize to false, eg: var map = new Map("map", { basemap: "topo", center: [-122.45, 37.75], // longitude, latitude zoom: 13, autoResize: false }); https://developers.arcgis.com/javascript/jsapi/map-amd.html#autoresize


1

you can use yourVectorLayer.getSource().getFeaturesAtCoordinate(point). the result is an array, if the its length > 0 then the point in, else not.


1

These kind of operations aren't supported out of the box in ol3. (maybe in the future). But you can use a library like http://turfjs.org , in this case you'll need https://github.com/Turfjs/turf-within or https://github.com/Turfjs/turf-inside You can use ol.format.GeoJSON to convert from a ol3-geometry and geojson for turf and back.


1

you don't need a programmatic hook into selecting a template immediately. just wire up logic to invoke the appropriate draw tool and pass edits to your hardcoded featureLayer of interest on draw-end immediately upon map load. afterward, you can still listen for selection-change on TemplatePicker and direct the edits somewhere else.


1

I personally could not get WFS-T working in OL3. Instead I reverted to manually crafting an XML statement and sending that to GeoServer. My situation was somewhat simpler. I had to insert new features, currently just points, instead of modifying them. But if you knew the the ID of the feature you wanted to modify, you can send an update XML statement. Try ...


1

Just downloading the HTML and a handful of the javascript is not the best way to get started with Cesium Sandcastle. Sandcastle uses Cesium in asynchronous mode, so all the underlying javascript is loaded as it is needed, and not combined into one file and accessible under a global Cesium object. You'd have to go through and manually download all the ...


1

onChange: function (value) { var min = value[0]; var max = value[1]; var expression = "POP_Total_Class >= " + min + " AND POP_Total_Class <= " + max; POP_Total.setDefinitionExpression(expression); }


1

Edited: There are several errors in your code, namely: Your style functions uses feature.getGeometry().getType(); This will always return "Point" for a Point geometry. A style function should be something like: var styleFunction1 = function(feature, resolution) { if (feature.get("type")) { return styles1[feature.get("type")]; } ...


1

You could use map.resize(); fire it whenever the browser is resized or when the display attribute of the container changes (dojo.on('id', 'resize', function(){})). Works on most occasions. Or you could use something like map.redraw() or map.refresh() (https://developers.arcgis.com/javascript/jsapi/featurelayer.html#redraw). Key is to tap into the window ...


1

You did not provide the template HTML for your button so this is just a guess as to the issue. Your button needs an 'onClick' event to execute your 'clearSelection' method. Something like this: data-dojo-attach-event="onClick:clearSelection" To display an average instead of a sum, you can use the original method you posted with a slight variation: ...


1

You cannot capture selecting a feature template and creating a feature on the map using, for instance, with Selenium IDE. This is because those things don't happen at the client side, and the testing software is not aware of JS API and considers editing templates to be just a group of CSS elements. Actually, you can test those kinds of interactions. ...


1

There are examples in the official documentation, here and code here. I don't use their API, though, so someone else might have a specific example. Try something like this: var l = cdb.vis.Overlay.create('layer_selector', map.viz, {layer_selector: true}) I think it's just an option to set, which by default is 'off' for layer_selector. See here. ...


1

I faced the same problem. I used another approach: First add a feature overlay to your selected feature: var avlFeatureOverlay = new ol.FeatureOverlay({ style: function(feature, resolution) { return avlGetStyle(feature, resolution, true); } }); Second add a click event to your map: map.on('click', function(event) { var resolution ...


1

I recommend using an IDE such as Eclipse rather than Notepad++. Once you've ascended the IDE learning curve, you will be more productive, and more employable (if that's a consideration). I'm developing an Android Smartphone navigation application using Java and Eclipse, a combination which works well for me. It should be possible to develop a GIS web ...


1

You would do this requirejs.config({ 'paths': { 'esri': 'http://js.arcgis.com/3.12/esri', 'dojo': 'http://js.arcgis.com/3.12/dojo', 'dojox': 'http://js.arcgis.com/3.12/dojox', 'dijit': 'http://js.arcgis.com/3.12/dijit' } }); Then require your modules in AMD style like this require(["esri/dijit/BasemapGallery", "dojo/dom", ...



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