Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Hot answers tagged

16

I would recommend looking into TileMill which is made by the same people that were workign on Maps On A Stick. TileMill was either part of Maps On A Stick, or is what Maps On A Stick became - something like that. I forget the connection. Anyway... TileMill will let you load geographic data, style it how you like and then create a set of PNG map tiles for a ...


10

I would agree with Moyles that the samples are just samples and dojo boileplate is a great resource however at current snovers boilerplate isn't a viable solution. You have two different versions of dojo going on there. The current js api still uses the classic require syntax of dojo 1.6.1 and does not support AMD. I'm sure that a newer js api will be built ...


9

Drag Marker and Geocoder with Coordinates https://gmaps-samples-v3.googlecode.com/svn-history/r49/trunk/draggable-markers/draggable-markers.html Entire code: <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false">&...


9

I have put together a simple function for you: function markerCoords(markerobject){ google.maps.event.addListener(markerobject, 'dragend', function(evt){ infoWindow.setOptions({ content: '<p>Marker dropped: Current Lat: ' + evt.latLng.lat().toFixed(3) + ' Current Lng: ' + evt.latLng.lng().toFixed(3) + '</p>' }); ...


8

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


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

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


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.


6

take a look at: http://s3.amazonaws.com/shapefile-js/simple.html and http://badassjs.com/post/845509816/rendering-binary-shapefiles-with-javascript both use javscript for rendering the shapefile


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

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


5

Your MAP file seems to indicate that your LAYER is coming from another WFS server using CONNECTIONTYPE WFS - are you sure you mean to do this? If you just want to enable WFS for a layer using data on your server then just define a standard LAYER. LAYER NAME 'MLSOA' TYPE POLYGON DATA "C:/path/shapefile.shp" CLASS STYLE COLOR ...


5

(1) and (2) are possible with eVis plugin (Documentation). Ad (3): You should be able to use Field Calculator to add the path to the filenames you already in attribute table. Field calculator is described here: http://www.qgis.org/wiki/Calculating_field_values. You can use + operator to concatenate strings.


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

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") library("maptools") library("leaflet") ...


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

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


4

you can get the coordinates of your shape as below code: vectorLayer.features[i].geometry.getBounds(); and also you can get covered area, centroid of your shape, vertices of ypur shape, length or geodesic area. if you want specific feature bounds, you can write order of your feature [i] place like this: vectorLayer.features[3].geometry.getBounds(); and ...


4

That's the markup generated by dojo for a specific kind of widget (dijit). You wouldn't actually build that yourself– it's the result of creating a dijit (either declaratively or programmatically). There are a number of button-style dijits available: http://dojotoolkit.org/reference-guide/dijit/form/Button.html http://dojotoolkit.org/reference-guide/dijit/...


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

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


4

Outside of polling for size changes, there isn't a way to detect a resize of a <div>. I usually use absolute positioning on the map container and let Leaflet handle resize automatically. Like this: http://jsfiddle.net/asnyder14/0gsfdxeg/


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