Tag Info

Hot answers tagged

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


3

The N or S value of Latitude is whether the location is North or South of the Equator. W or E for Longitude, is W or E of the Prime Meridian. The number that follows the letter is the Degree of Latitude or Longitude, followed by minutes and seconds of Latitude/Longitude displayed as floats. The alpha-numeric values should not be ignored as they are part of ...


2

try marker.dragging.disable(); and to re-enable: marker.dragging.enable(); reference: http://leafletjs.com/reference.html#marker-dragging


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


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


2

For questions like these, I find Tom MacWright's Mapmakers Cheat Sheet useful. In your particular case, look at the section about lines: https://github.com/tmcw/mapmakers-cheatsheet#lines. As already mentioned by @john-barça, a tiling solution is probably best; I'm personally not a fan of WMS though, I usually find mbtiles etc easier to work with.


2

Opacity is partially implemented in qgis2leaf. The problem is the many ways in which opacity is specified in QGIS: layer transparency fill transparency fill style rgba colours We're still in the process of implementing the full range of these in qgis2leaf. It has improved in the last few weeks, so make sure you have the latest master from Github. More ...


2

With the current version you are able to create unfilled polygons. check this : video Simply use no brush fill instead of solid fills. this issue was covered here: https://github.com/Geolicious/qgis2leaf/issues/187


2

Seems like a bug to me. Also reading the README.MD in Qgis2leaf git gave me the impression that opacity should be transffered to the GEOJSON. You might consider opening a bug report. Exporting an example data with opacity of the fill color == 0 %, gave the following in qgis: and the following (as yours) after exporting to leaflet using qgis2leaf plugin. ...


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


1

UPDATE I found a way of handling the search using FuseSearch! .I have used it in my code and it works well.Only that when I click on the output list,it doesn't show the corresponding polygon in the map. Code var options = { position: 'topright', title: 'Parcel Search', placeholder: 'Parcen No,ID, Reg Name', maxResultLength: ...


1

If you mean you want this to be an actual clickable link, you are most of the way there. I would break up how you construct the content of the popup to be a little more explicit: var hed = $("<div>", { css: {fontSize: "16px", marginBottom: "3px"} }).appendTo(popup); var span = $("<span>", { text: "District " + properties.datazone + ": " ...


1

I think you are mixing up a couple of things. When you install Geoserver, it comes with a lite distribution of OpenLayers. That is used to preview the data once you publish some. But this functionality is only suitable for previewing, and not as a production front-end. If you want a Production quality front end, you need to develop that yourself. You can ...


1

Try projecting your data to 4326 (WGS84) instead of 3857. Leaflet expects coordinates in geojson to be 4326. It'll probably easier to reproject your data before including it your app rather than adding Proj4Leaflet to do on the fly reprojection. Plus, if you don't use Proj4Leaflet, that's one less dependency in what you're developing.


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

you have to change the css, but also the javascript that is used to generate the html for the legend. From the section of the tutorial where the legend is generated ("Creating a control with a legend..."), change the part with the comment "loop through our density intervals...", to something like the following var legend = L.control({position: ...


1

While your PHP looks to be creating an array, I'm not sure that you're going to have consistent luck getting JS to read it that way (an arrant space here or there, etc.). At least I've tried that in the past, only to realize that while it LOOKS like a good array, it isn't. I think you're better off just returning your MySQL as a true array and then using ...


1

Simply changing the zoomIntr value doesn't update the value associated with mapURL. To illustrate, try this: var zoomIntr ="zoom_10"; var mapURL ="maps/mbtiles.php?db="+ zoomIntr +".mbtiles&z={z}&x={x}&y={y}"; var zoomIntr ="zoom_17"; console.log(mapURL); Furthermore, simply changing mapURL won't force the map base layer to change. To do ...


1

Use the setStyle() method to set the style for all features, and use the eachLayer() method to set the style by feature. So, something like: var jsonLayer = L.mapbox.featureLayer(geoJson).addTo(map); // set style for all features jsonLayer.setStyle({stroke: '#555555', strokewidth: 1}); // set style by feature ...


1

Here is what I do: In your GeoServer content.ftl file (explained here FTL), add a hidden list item like this: <li style="display:none";>popup</li> You can change the key word 'popup' to anything you like. You will be searching for this word in you popup javascript. This word will only appear in the getFeatureInfo request if there is a feature ...


1

You can switch to infoformat=application/json so you will get a json response from Geoserver. Then just check how many features are returned and if features.length>0 is true show the popup otherwise not. For this solution you will have to create a table from the json-response. You could do something like that: set infoformat in your ...


1

This is how I would form the query you're asking about using ST_MakeEnvelope() and the && operator. You can request whatever field data you want, in addition to the geometry in GeoJSON format using ST_AsGeoJSON(). Also I recommend taking advantage of that function's ability to specify a max decimal precision value. Here I'm requesting geometries ...



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