Hot answers tagged

7

You're asking two questions here: administrative borders related to territorial disputes, and map label localization. Since you mention OpenStreetMap, I feel obliged to answer: The OpenStreetMap Foundation changed the policy regarding territorial disputes in 2013. You can find the full document here, but let me quote the relevant paragraph: Borders and ...


5

I couldn't get your strategy that both custom-popup and leaflet-popup-content-wrapper style classes have overflow: auto property to work properly. I moved overflow: auto property to leaflet-popup-content style class which is applied only to inner content of popup. Here is working solution that has been tested on IE11 and latest versions of Firefox and ...


2

Tile layers are a set of image files, usually about 256x256 pixels, that are accessed via a URL like /path/to/map/$x/$y/$z.png, so that, for example, /path/to/map/3/2/4.png returns the tile (part of the bigger image) that is 3 tiles along, 2 tiles down, of zoom level 4 of the tile layer (I might have the x,y,z, order wrong here, but you get the idea). The ...


2

IvanSanchez is rigt about first problem: layer with markers has to be added to the map inside the (async) callback function for the $.getJSON call. Bill Chappell is right about danger of using absolute path to resources. Paths should be always relative to the main HTML page with the map. Best practice is to put them in subfolders of folder with map HTML ...


2

This is also an issue: <script src="C:\ICBHI\test\leaflet.ajax.min.js"></script> <script src="C:\ICBHI\test\jquery-1.9.1.min.js"></script> <script src="C:\ICBHI\test\leaflet-providers.js"></script> These should be off a web site. I'm betting if I view the site from another PC, those files are not on my C:\ drive, so ...


2

GDAL can create vector tiles with the MVT driver https://gdal.org/drivers/vector/mvt.html For converting GeoJSON data into vector tiles which are saved into MBTiles database file use a command like ogr2ogr -f MVT -dsco FORMAT=MBTILES -dsco MAXZOOM=10 target.mbtiles source.geojson Another option is to use Tippecanoe the https://github.com/mapbox/tippecanoe....


1

I found the solution. GeoServer uses basic HTTP authentication security, which is stored in a key until the user doesn't close the whole browser window. You can't sign out from it, just overwrite the authentication with fake username/password. This causes "logging off". Just call this function (ajax needed): function logout() { $.ajax({ url: 'http:...


1

I have a solution. You can load the geojson files using jquery. for this you have to add jquery in your program; i.e. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script> And replace your code by: $.getJSON("{% url 'work' %}", function(data){ var geojson = L.geoJson(data, { onEachFeature: function(...


1

With the first GeoJSON you wait till data is loaded and then add it as layer. With the second GeoJSON you are missing this step so data is not available yet at the time when it's being added to the map. Order of map objects creation is also important. First create map, then layers and then add layers to the map. It should look something like this: var map ...


1

After testing and debugging I concluded this is a bug in either the docs or the plugin (or both). It seems to be caused by the asynchronous nature of loading Esri feature layers. My work-around solution is to manually call resetStyle for vector features from within onEachFeature so that I can apply a custom initial style to the polygon and line features. ...


1

Final solution is quite simple but was very hard to come by. Every element displayed on Leaflet map is placed in one of the standard map panes, which are DOM elements used to control the ordering of layers on the map. It is also possible to have user defined panes for fine tuning display order of overlays with DOM zIndex property. User defined pane has to ...


1

The main issue I see is that you're using L.TileLayer.DeepZoom from https://github.com/alfarisi/leaflet-deepzoom . Approaches like L.TileLayer.DeepZoom and every other plugin listed in the "Non-map base layers" section of the Leaflet plugins list are, well, not meant to be used with maps. In other words: L.TileLayer.DeepZoom, L.TileLayer.Zoomify and L....


1

The option I searched was fitSelectedRoutes, setting it to false does the job. var map = L.map('map'); L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors' }).addTo(map); L.Routing.control({ waypoints: [ L.latLng(57.74, 11.94), L....


1

Problem is that you mixed up latitude and longitude when reading from data source http://api.spitcast.com/api/spot/all. If you exchange coordinates, it's OK. Relevant part of code should look like this: //call function to get all surf spots function getAllSpots() { fetch("http://api.spitcast.com/api/spot/all", { method: "GET" }) .then(res => ...


1

First it has to be noted that solution below is modification of Leaflet.CountrySelect plugin, written by Anika S. Halota. Requirement that control would work with any JSON file is to broad, since file must have defined structure that plugin can work with. Since file has to include geometries, the obvious candidate is then GeoJSON feature collection, where ...


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