Tag Info

New answers tagged

0

You just have to add 'mouseover' and 'mouseout' event listeners to your newly created layer. You will also want to change the offset of the popup to make it higher. If not, you will have annoying mouseout when the mouse comes near the arrow of the popup, causing the disappearance of the popup. gpsMarker = new L.geoJson(gjsonMarker, { onEachFeature: ...


1

for a GeoJSON featureCollection, you could do something like this: var myGeoJSON = { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "name": "hi", "num": 9, "other": null }, "geometry": { "type": "Point", "coordinates": [ 23.203125, ...


1

I would download data from here if nothing works and convert shapefiles into geojson.


0

If you are looking to limit exposure of raw data the best solution would be to use something as general as geoserver with tilecache. This would be highly performant, only as costly as your time, and would provide the end users with far less useful(theft wise) data, as they would have to do image analysis. You could have the server up on AWS with your ...


4

A simple approach is to make one if you can't find one. Get the free OrdnanceSurvey OpenData Boundaries dataset. This contains several boundary datasets in either Shapefile or MapInfo formats. Identify the one you need and load it into a competent GIS (QGIS is free). Then export as GeoJson. Alternatively use org2ogr (also free) to convert it on the ...


3

I also haven't been able to get L.mapbox.featureLayer() to load vectors I've uploaded to MapBox. Vector Tile source .mbtiles files are no longer .geojsons but have been converted into a bunch of tiled .svgs combined into one .mbtiles file, so I'm not sure if mapbox.js has the ability to render vector .mbtiles the same was it renders hosted .geojson files. ...


1

what about L.mapbox.featureLayer('your_id').addTo(map); Just tested it again and it works fine. Have you added these two lines with the up to date API and CSS? <script src='https://api.tiles.mapbox.com/mapbox.js/v2.1.5/mapbox.js'></script> <link href='https://api.tiles.mapbox.com/mapbox.js/v2.1.5/mapbox.css' rel='stylesheet' />


0

You could use the method "getFeaturesByAttribute" or iterate through all features: for(var i = 0; i < yourgeojsonlayer.features.length; i++) { if(yourgeojsonlayer.features[i].attributes.searchedAttribute == 'searchedValue') { selectFeatureControl.select(yourgeojsonlayer.features[i]); break; } } Ps: makes necessary to create a select ...


0

I'm not a MapBox-User, but the syntax to get the feature layer seems to be a bit different: https://www.mapbox.com/mapbox.js/api/v1.6.1/l-mapbox-featurelayer/ Try this: var featureLayer = L.mapbox.featureLayer() // loads markers from the map `examples.map-0l53fhk2` on Mapbox, // if that map has markers featureLayer.loadID('examples.map-0l53fhk2');


2

The use of && will return quicker than ST_Intersects, as it is only checking bounding boxes, which is the first stage of any spatial intersection query, via the bounding boxes stored as part of R-Tree indexing (technically a GIST index in Postgis, but the bounding box is still used in index construction). As, the second stage, the actual intersection ...


0

Here are a couple of thoughts on what you can do to boost performance: Send a BBox to server and return only points within it Use a library like turf.js http://turfjs.org/ on the client to only draw points within the maps current BBox Marker Clustering https://github.com/Leaflet/Leaflet.markercluster Use SVG icons instead of images Only return geometry and ...


1

Yes, regex is supported with the =~ operator. For example, [name=~'^.{12,}$'] { text-name: ''; } will remove labels above a certain length. You can find this and more examples in this Advanced CartoCSS techniques slide deck.


0

You can still use L.control, you just need to extend it and create the select within the control. I cannot claim this as my own, but here is a JSFIDDLE. I found the link as it was reported as an issue in the Leaflet GitHub page. Notice how you create the innerHTML for the control div: var div = L.DomUtil.create('div', 'info legend'); div.innerHTML = ...


0

I have looked into this before...and although I do not know how to export JSON in the exact web map spec that you referenced, you can come close using the Item Data operation of the REST API which can exports Web Map data. This might have the information that you require (or not). As I mentioned, the JSON object returned using this operation is not the ...


1

To write a geojson object to a temporary file this function can be used: import geojson import tempfiile def write_json(self, features): # feature is a shapely geometry feature geom_in_geojson = geojson.Feature(geometry=features, properties={}) tmp_file = tempfile.mkstemp(suffix='.geojson') with open(tmp_file[1], 'w') as outfile: ...


1

To parse or deserialize geojson in Java REST webservice, i prefere to use geojson-jackson , which integrates very nicely with jackson.


4

There are couple of alternatives. First one it to use the -select option that is documented on the manual page http://www.gdal.org/ogr2ogr.html -select field_list: Comma-delimited list of fields from input layer to copy to the new layer. A field is skipped if mentioned previously in the list even if the input layer has duplicate field names. ...


1

This is not directly available through the API. The PrintTask can be used to get the Web_Map_as_JSON. map.on("load", function(){ require(["esri/tasks/PrintTask", "dojo/_base/json"], function(PrintTask, JSON){ var printTask = new PrintTask(); var Web_Map_as_JSON = JSON.toJson(printTask._getPrintDefinition(map)); }); });


5

Geotools as a support for geojson. See here. Otherwise, you could simply use a typical JSON parser (such as json-simple) together with the geoJSON spec, which is really easy to use. The best solution depends on what you want to do with the parsed information.


0

I recently ran into a similar problem. Working from that same demo IPython example, I applied HUD rental data to generate the Folium choropleth, but I ran things via a program in Spyder, then tried to open the generated map in Chrome. Nothing showed up. I eventually cottoned on to the Chrome console, opened it(ctrl-shift-J on Windows) and then attempted to ...


0

change the default SRC is the reason for the misplacement. If you want lat/lon coordinates, turn that back to the original value, and save the layer to a different file name and CRS EPSG:4326 using Rightclick -> Save As...


2

Try something like this, sorry had to replace your variables with real values so I could test, but should be easy enough for you to replace back with what you had. Also note I replace your ST_MakeBox2D/ST_SetSRID with ST_MakeEnvelope which is shorter and generally more accurate. WITH c AS (SELECT -88.505 As topLon, 41.8046 As topLat, -88.405 As botLon, ...


0

disclaimer: i work for esri and help maintain esri leaflet. opinion: it would also be extremely straightforward and cost effective to use ArcGIS Online to publish the points in a queryable, but not editable hosted feature service and use our leaflet plugins to authenticate and display the data. ...


0

You can create or import routes on bikemap.net. After that, export them as GPX, load the GPX file in geojson.io, and save it as GeoJSON. You can add as many GPX files as you want to a single GeoJSON.


0

Well the idea is to display additional GeoJSON layers over the built-in GraphHopper ones. Here is the code, https://graphhopper.com/#community and what i am trying to do is to get an additional layer to display POI information from a GeoJSON file. Here is a sample of the information available in the GeoJSON file : {"type": "Feature", "properties": { ...


2

Geoserver is an OGC compliant Web server which can serve out data in OGC's web services, namely WMS, WFS & WCS. You want to get GeoJSON Tiles, and use it in your Leaflet Map. GeoJSON tiles are not a OGC standard, and GeoServer can not serve out GeoJSON Tiles. TileStache on the other hand, can serve out GeoJSON Tiles from ESRI Shapefile, PostgreSQL, ...


1

"handle" is in the properties of the feature, so it just needs to be d.properties.handle Try: feature.attr("class", function (d) { return "code " + d.properties.handle; });


2

Yes. You have to send your data from the client to the server and let server-code handle the database-insert. You should look into HTTP POST through jQuery or other libraries as a way to asynchronously send your data from the client to the server.


0

I have used the PostGIS code with success from Bryan Mcbride's Github Page. It also contains a MySQL version of the code and can also be used for other geometries like polygon and line.


3

While the answer that you have posted works, it doesn't really get to the root of the issue. The error indicates that you are trying to load the JSON from a a location that is not on the same domain. In the OP's case, the application is not being hosted from a webserver, and is trying to load the JSON from the file system. The real solution for this is to ...



Top 50 recent answers are included