Hot answers tagged

12

Problem The <font> tag's size property is only defined for values of 1 through 7. MDN says about the <font> tag: Obsolete This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it. and later: [...] For any new web development, styling ...


10

You should check the Folium version you are using. 0.2.0 has changed how popups are added, as explained in this issue thread: https://github.com/python-visualization/folium/issues/360 Popups now no longer take html automatically but rather one must pass in a folium.element.IFrame of the html. This notebook shows the differences in folium 0.2.0: http://...


8

This is a general answer since you didn't provide any code to work with. Note that I assume you have managed to work out the QGIS2LEAF plugin. The output of the plugin gives you a folder with an index.html file, which contain the webpage main code, and few more folders described below. CSS: contains CSS styling files, including own_style.css that is meant ...


8

As others have already mentioned, HTML formatting for labels is currently limited to colors. But with a very nice undocumented feature we can build dynamic labels, using label backgrounds with inline SVG expressions. Just as good as HTML formatting and best of all, we can even embed raster images (i.e. PNG) that are stored in a BLOB column (i.e. "image&...


7

You need to call setVisibility(true/false) on the layer. setVisibility All you are doing in your code is changing the value of static variables. This will not trigger any action on the layer. In your checkbox handler, you need to get a reference to the layer and change the visibility: triangleLayer1.setVisible(value);


7

Use the QGIS To Web plugin? https://github.com/tomchadwin/qgis2web You'll have to find somewhere to host it, of course, but that plugin will help you create the web map.


7

If your image is smaller than 16000 pixels high/wide, then consider using a L.ImageOverlay, and check if the performance is acceptable for your use case. (Web browsers start breaking with images larger than that because of in-memory graphical texture sizes). There are a couple of approaches to this: Set up a Geoserver instance (or mapserver, or mapproxy) ...


7

You can create a more complex JavaScript function to create your div and call it when ever you want in your html document : <script> function expr(field, class_name) { return "CASE WHEN \"" + field + "\" IS NOT NULL THEN '" + class_name + "' ELSE '0' END" }; function is_circle() { var circle_expr = expr("125", "circle"); ...


6

This is because boundedBy / bbox is a property that OpenLayers creates when parsing the GML, it is not a real feature property. So when you update, you should clone the feature and get rid of it. Some example code: // do a WFS transaction to update the geometry var properties = feature.getProperties(); // get rid of bbox which is not a real property delete ...


6

If you're using Portal for ArcGIS or ArcGIS Online you can manage your configuration files via the ArcGIS Online Assistant. Login with your Portal or ArcGIS Online credentials and select 'View an Item's JSON' under the 'I Want To...' menu. You can't directly run a batch script from here, but you can copy this JSON code, edit it locally, and then 'upload' the ...


6

There is a setOpacity method for TileLayer. This should do what you want: $('#rangeSlider').slider().on('slide', function (ev) { sliderVal = ev.value; background.setOpacity(sliderVal/100); }); EDIT: Here is an example fiddle with sliders for controlling opacity of both the background (with .setOpacity) and a vector layer (with .setStyle): http://...


6

Try to set the selfcontained variable to FALSE. That worked for me. Beside that make sure that the Shape of France is saved with the coordinate system WGS 84 (EPSG:4326). # install packages install.packages(c("rgdal", "maptools", "leaflet", "htmlwidgets"), dependencies = TRUE) # load libraries library("rgdal&...


6

I suspect that the JavaScript code that you provide is within the index.js file? In that case, you just have to re-order your <script> tags to make sure your loc_infra variable is defined and assigned before you try to use it: <script src="loc_infra.js"></script> <!-- define and assign first --> <script src="index.js"></...


6

You asked about OpenLayers map but tagged Leaflet also. If you are open to leaflet, here is an example: Map from GeoJSON, that reads from a GeoJSON file using JQuery and plots the points as circleMarkers, it has a popup and will zoom to the extents of the points: http://www.gistechsolutions.com/leaflet/DEMO/Drink/Drink.html This example needs to run from ...


5

I think you can solve this problem, if you adapt your situation, like in the example bellow. Presuming this is how it looks the vector layer's attribute table: Here's the images' storing folder: And this is the annotation.html : <b> [% "name" %] </b> <br /> <img src=file:///c:/temp/images/[% "img_src" %].png /> Eventually, ...


5

This only a partial answer and lacks all python but too long to fit into a comment field. Your data is rather easy to convert into WKT: capture the coordinate part switch commas to spaces and spaces to commas close inside WKT polygon: POLYGON ((...)) POLYGON ((39.655756 -4.034769,39.655757 -4.034769,39.655758 -4.034769,39.655800 -4.034788,39.655885 -4....


5

Use a table: <table> <th colspan=2><h1>ASSET</h1></th> <tr><td class="bold">NAME:</td><td>[% "First Name" %] [% "Surname" %]</td></tr> <tr><td class="bold">COMPANY NAME:</td><td>[% "Company Na" %]</td></tr> [...] </table>


5

Your assumption in the last paragraph is actually true, because this has nothing to do with Mapbox GL JS, but only with basic HTML. Basically you have to define a link with the <a> tag inside your <h3> tag in the popup like this: .setHTML('<h3><a href="' + feature.properties.URL + '">' + feature.properties.Company + '</a></...


5

I set font-size in a surrounding span when font size alone didn't do the trick <span style="background-color:%s; padding: 5px; font-size: %spx;"> <font face="%s" color="%s">%s</font> </span> https://github.com/anitagraser/TimeManager/commit/75fae61da07ab5c7867287706751d476a6502851


5

Three things needs to be addessed: 1) as @snaileater said, the path must be quoted 2) the ending </img> tag must not contain spaces, else is will be printed as text 3) a local file URL must start with file:\\ Here is a example displaying a local file: [% concat('<img src=\'file:\\',"path", '\' width="400"></img>') %]


5

If you use CSS size definitions in QGIS, it‘s best to use em relative units instead of pt or px. pt/px units are changing with the dpi settings of the Layout.


5

Well, I've gotten my kluge to work, though I hope someone still comes up with a better answer! I've created custom functions for manipulating blobs via expressions (see definitions below.) I can now use the Field calculator to select all features where "PhotoBlob" is Null and then update PhotoBlob to file_to_blob("PhotoPath"). And I use expressions like ...


4

When defining the columns for your grid, you can specify a formatting function to transform the value from the data store to something else. To do this, you need to modify your column definition and also define the function that will turn your URL into a link. Here's the relevant code: grid = new OnDemandGrid({ store: Memory({ idProperty: "...


4

Please check out the following code <html> <head> <title>tile.stamen.com: OpenLayers</title> <script type="text/javascript" src="http://www.openlayers.org/api/OpenLayers.js"></script> <script type="text/javascript" src="http://maps.stamen.com/js/tile.stamen.js?v1.1.2"></script> <script type="...


4

It works in IE11. But if you access it as a file path like C:\projects\index.html then it will not load due to browser security. Not sure about exact details why. Try the sandboxed sample in IE11 http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=map_simple This worked because the page has loaded as a web URL Suggest you to setup a web ...


4

There's a plugin called Leaflet.label which does what you want: https://github.com/Leaflet/Leaflet.label


4

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


4

I normally upload the whole export folder to an accessible folder on my server and implement the map with an <iframe src="relative path to the export folder"> </iframe> and that's it!


4

Your events are propagating to the map. Leaflet provides DomEvent methods to prevent this, for example (using jQuery): $('div').each(function () { L.DomEvent.on(this,'mousedown',L.DomEvent.stop); L.DomEvent.on(this,'click',L.DomEvent.stop); L.DomEvent.on(this,'touchstart',L.DomEvent.stop); }); UDPATE Based on comments below, the following ...


4

It seems you re mixing some concepts features[i] = new ol.format.GeoJSON( url: './testData.geojson') }; The above code can't work because the ol.format.GeoJSON API does not accept url as a parameter eg the official doc. You also try to loop on a GeoJSON call (if I consider above sample was intented for this) The normal way (there are more than one) ...


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