Tag Info

Hot answers tagged

2

We use a trick like: <style type="cartocss/text" id="simple"> #earthquakes_cdbjs_lesson3{ marker-fill: #FF6600; marker-allow-overlap: true; ... } </style> and after that cartocss: $("#simple").text();


2

You need to initialize your map object. See the source code here for an example: http://leafletjs.com/examples/quick-start-example.html Add something like this to harris.js before you call map.on. var map = L.map('map').setView([51.505, -0.09], 13); What's happening is map.on is undefined. Map itself is not defined in JavaScript, but by default DOM ...


2

Since Github supports CORS, you can use jQuery's getJSON() or a micro-library like corslite to grab your geojson without altering it. Here's a working example using $.getJSON() (notice that I took out your script tag referencing your geojson file): <html> <head> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" ...


2

Your github file cannot just contain a value; it must define a variable that will be defined when the file is included as javascript. var geojsonFeature = { "type": "FeatureCollection", "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, .... }; Then you can use this variable as an input to your GeoJSON layer var ...


1

Try this change to your layer definition: var wellsLayer = new ol.layer.Vector({ source: new ol.source.GeoJSON({ projection: 'EPSG:3857', url: 'data/WELLS.geojson' }), style: customStyleFunction // "style:" is inserted and ',' is removed });


1

The thing is that the legend of a wms service is actually an image. Having said that how can you display an image inside the tree? what I usually do is either use the Legend Panel, which i can understand is neither handy or neat or use an event to manually get the legend of the layer and display it somewhere more handy. for example: ...


1

I found the solution, here it is for it is helping anyone Following this answer http://gis.stackexchange.com/a/118818/42868 There is an unstable option for the ol.source.GeoJSON object, so adding it in this way made it work var source = new ol.source.GeoJSON({ url: 'geojson url', projection: 'EPSG:3857' });


1

This one uses REGEX based US address parsing: http://search.cpan.org/~timb/Geo-StreetAddress-US-1.04/US.pm And it's javascript port: https://github.com/hassansin/parse-address. You can probably do the same for other countries.



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