Tag Info

New answers tagged

0

Two pieces of advice (which may or may not constitute an answer--haven't tested your code myself): Use Promise Objects Available within jQuery (as well as many other js libraries). Read the docs: essentially, a promise object allows you to work with variables that point to data that may still be loading asynchronously. E.g. var promiseData = ...


0

Your map is being shown in the browser before all the GeoJSON is loaded into your layers. Try wrapping your JavaScript with jQuery's ready() method. $(document).ready(function(){ <put all your code in here> });


0

I haven't found out yet why exactly this does not work. but if you are interested in a "quick and dirty" workaround until you have found the error you could use this: map.setCenter(new OpenLayers.LonLat(-91, 25).transform('EPSG:4326', 'EPSG:3857'),4); map.panTo(new OpenLayers.LonLat(-90, 25).transform('EPSG:4326', 'EPSG:3857')); ...


0

In OpenLayers the map holds that information so a call to map.getScale() will return the current scale denominator of the map. If no baselayer is set, returns null. All you need to do is put "1:" in front of it.


1

Yes, for sure. Leaflet has a method called getBounds() that finds the bounding coordinates of the current map view. You can use this with the CartoDB SQL API with CartoDB.js to do a custom query based on the view. $('#getTotal').on('click',function() { var bounds = map.getBounds(); console.log(bounds); sql.execute("SELECT SUM(pop_min) ...


0

have you looked at this answer? GeoServer 2.3 how to enable jsonp. Depending on your version of GeoServer you may have to edit web.xml


0

Try to change the dataType in your ajax request to 'jsonp' The documentation indicates callback—Applies only to the JSONP output format.



Top 50 recent answers are included