Tag Info

New answers tagged

1

You only have one table in the configuration with two of each property (title, queryOptions, etc). The effective result is that only the second property with the same name is evaluated and used. To fix this, you need to add a closing curly brace } to end the configuration object for the first table followed by a comma. Then an opening curly brace { is ...


0

According to the api ol.Map.html#forEachFeatureAtPixel If you put a return statement that should return only one object. In your case: var firstFeatureFound = map.forEachFeatureAtPixel(pixel, function(feature) { return feature; }); el.innerHTML += firstFeatureFound.get('Proj_Client') + '<br>';


1

An idea is: Use the lidar data to classify ground and non-ground points. Then, build a Digital Elevation Model (DEM) from the ground points. Here is a way of doing it. Use the RGB values from the aerial images to color code the lidar point cloud. Here are examples showing how this can be done. Now, it is possible to display the DEM and the color-coded ...


2

I just found this post, from your post here and wanted to share some Python code I wrote that helps select a given feature in a JavaScript app. This code is obviously very specific to the Selenium and Python bindings, but I've got good mileage from it across different browsers, OS and screen resolutions. The idea is that if you Know the real world x/y of ...


1

I found a solution here: http://stackoverflow.com/questions/17005784/clustering-markers-on-mapbox-leaflet I used this code to display my markers: var markers = new L.MarkerClusterGroup(); var geoJsonFeature = rodents1; var geoJsonLayer = L.geoJson(rodents1); var map = L.mapbox.map('map','mapbox.streets') .setView([42.35,-71.08],13); ...


1

Not clear if you want all the points to be the same color, or styled according to some property in your data (a category of animal, etc.). Assuming the latter, you could set up your map slightly differently and use the pointToLayer function to return a circle marker for each point: // make an object to lookup a hex color for each category in your data var ...


2

From the API docs (http://openlayers.org/en/v3.4.0/apidoc/ol.Map.html?unstable=true#forEachFeatureAtPixel): To stop detection, callback functions can return a truthy value. map.forEachFeatureAtPixel(pixel, function(feature) { el.innerHTML += feature.get('Proj_Client') + '<br>'; return true; });


2

The route1Data you are trying to remove is not the original route data that was added. You need to declare your layer outside of vlocation. I modified vlocation to the follow and it adds and removes the layer in my fiddle. var currentRoute; function vlocation(locx, xx) { var vdatax = locx; if (currentRoute) map.removeLayer(currentRoute); if ...


0

Your 'var CountPt' part of the code (which does the counting of points) needs to be moved to within the updateBuffer function so that it constantly reruns. function updateBuffer() { var pointMarker = marker.toGeoJSON(); buffered = turf.buffer(pointMarker, 1, 'miles'); buff = L.geoJson(buffered); buff.addTo(map); ...


0

So looks like one solution is just to remove the controller and and recreate it. So when I initialize it outside of my Leaflet.draw event handler, declare it as a variable. controller = L.control.layers(baseMaps, overlayData, {position:"bottomright"}).addTo(map); and then within my function controller.removeFrom(map); //Add the new data to ...


0

In what way is the script 'not working' - there's several things people would need to know to help you with the issue: 1) what's the file you're trying to load and is it exactly 100 polygons? 2) Are the polygons relatively small - e.g. 10s of points or are they quite large? 3) What library versions are you using? OL2/3 release versions? 4) Does the JS ...


0

You need to refer to the geometry.coordinates of the data object (d). So, given, something looking like this, ie, referencing the features array directly from you original featureCollection for brevity (ie, equivalent to squareData.features): var features = [ { "type": "Feature", "properties": { "gid": 2196272, "acq_date": "2014\/08\/29", ...


1

The OpenLayers demo requests a single tile so there's no tiling issues to work around. When individual tiles are requested, as in the case by Leaflet.js, GeoServer renders each tile individually without knowing about the other surrounding tiles. This is most often run into when labels show up for a large feature once in each tile, but your symptoms looks ...


1

the cryptic error is being thrown because query.outFields expects an array query.outFields = ["*"];


0

I just find out how to do it and is very simple, just set the CQL_FILTER to null: //My var map is previously declared var layerFromMap = map.getLayersByName(input.name)[0]; //If my input is empty then I should delete the filters, like resetting the search if (input.value.length > 0) { layerFromMap.mergeNewParams({ 'CQL_FILTER': input.value }); ...


0

The feature from the Feature Overlay is always returned. To filter out the filterOverlay just test if the layer parameter is defined. Like this: var stateFeature = map.forEachFeatureAtPixel(evt.pixel, function (feature, layer) { // If layer is undefined, that means it's a feature from a FeatureOverlay if (layer) { return feature; } }, null, ...


0

Seems that you need to order the geojson first. // take your geojson features var featuresArray = geojson.features; featuresArray = featuresArray.sort(function(a,b) { return parseFloat(a.properties.Timestrg) - parseFloat(b.properties.Timestrg) } ); var orderGeojson = { "type": "FeatureCollection", "features": [] } orderGeojson.features = ...


0

Could you try setting the clickable attribute to true? polygons.push( new google.maps.Polygon({ paths: arr, strokeColor: '#FF0000', strokeOpacity: 0.8, strokeWeight: 1, fillColor: '#FFF000', fillOpacity: 0.8, clickable: true }) ); I don't remember if it's enabled by default.


-2

You could just use a data:time field to label the data.


0

Leaflet.Sleep will make that job easy, and it's plenty configurable It turns off scroll events when they're not needed and 'wakes' your map when they are.


2

At the moment I still prefer OpenLayers2. You can find a nice tutorial here: http://www.gistutor.com/openlayers/22-advanced-openlayers-tutorials/47-openlayers-wfs-t-using-a-geoserver-hosted-postgis-layer.html or even have a look at the "official" openlayers-example: http://dev.openlayers.org/releases/OpenLayers-2.13/examples/wfs-protocol-transactions.html ...


4

The following will open a new page when the drawn feature is clicked: map.on('draw:created', function (e) { var type = e.layerType, layer = e.layer; layer.on('click', function(){ window.open('http://www.example.com','_blank'); }); drawnItems.addLayer(layer); }); This will bind a popup with a url: ...


0

If anyone get stuck with identifying layer type in OpenLayers 3, there is a more sophisticated, JavaScript method to achieve this. As layer objects are created with layer constructors, the native instanceof JavaScript function can be used to check for layer type. As the identification of a layer type usually gets into an if or switch clause, one could ...


2

there are two different way you can try, 1) you need to host your web server to receive the file that client uploaded. The file will be processed in your server and return the geojson file to the front-end. here is an example (with php) http://www.w3schools.com/php/php_file_upload.asp then you will get a geojson file to show in ol3. 2) the other one ...


0

have you tried to change the css rule for the titlePane-Class yet? for example: .esriPopup .titlePane { color: #ffffff; cursor: default; line-height: 20px; background: green !important; }


0

I had this problem like you! You should write your data in each rows with spacing between columns by Tabs.. and also, it is important that fill the last row by spaces as strings and tabs.. it should be work!



Top 50 recent answers are included