juminet
  • Member for 6 years
  • Last seen this week
Marker appears in different position when zooming
Accepted answer
5 votes

When the marker icon is moving through the map while zooming, it is caused by a bad anchor with respect to the dimensions/shape of the image of the marker. So you have to define a proper anchor in ...

View answer
Openlayers 3 equivalent of render intents of OpenLayers.Stylemap?
Accepted answer
4 votes

In OpenLayers 3 (or 4), features selection is handled by an interaction. The relevant doc about selection is here: http://openlayers.org/en/latest/apidoc/ol.interaction.Select.html Here's a piece of ...

View answer
How to add 'top' and 'bottom' directions with leaflet marker label
Accepted answer
4 votes

The method bindLabel from the plugin Leaflet.label is deprecated but its functionality was included in Leaflet core from version 1.0 using tooltip. This should work within your code: var marker = L....

View answer
show/hide button for leaflet legend
4 votes

For this, you need to write a few lines in Javascript. Many solutions exist, depending if you want to use JS and/or CSS frameworks or not. Here is below an example with jquery: First, add a button ...

View answer
OpenStreetMap: need a tile service with English labels in non-English countries
3 votes

In OpenStreetMap, place names can be edited in several languages. For instance, look at the capital of China, which is defined in OSM in hundreds of languages (see the name:en, name:fr, name:es, etc. ...

View answer
hasLayer and removeLayer methods not working on leaflet map as expected
3 votes

I tested your code with a geojson of mine and it's working. I've just put two console.log() to test it. If I add the layer to the map before, the "if" condition is working (console says: the map had ...

View answer
Openstreemap Overpass API to get Couture lines
3 votes

As already answered, there is no contour lines data in OSM, but only some elevation data for mountain peaks and other points. For your information, you can find how are generated the contour lines of ...

View answer
Extract land cover data from Google Earth?
3 votes

Though land cover/land use (LCLU) maps are produced from classification of satellite imagery, I don't know if you can find such information in Google Earth. However, you can access this information ...

View answer
MapServer WMS background color in OpenLayers 3
Accepted answer
3 votes

By default, areas outside of the layers of a WMS are set as transparent by OpenLayers. So add this: var params = { transparent : false } in your variable params. Works for me. J.

View answer
Applying different styles for polygons in OpenLayers
3 votes

See this link for your answering your question, or follow the steps below: You can set different styles to a layer by using a function (here: styleFunction) that is bound to the layer: var layer = ...

View answer
GeoJSON interaction with leaflet
2 votes

I think it is a asynchronous issue: your function $.getJSON does not ends before the remainder of the code is executed. Therefore, the object people actually doesn't exist when your code want to use ...

View answer
Transport layer on OpenLayers 3 map: ol.layer.OSM is not a constructor
Accepted answer
2 votes

The example from the Thunderforest website was made for OpenLayers2. For OL4, I think you should use ol.layer.Tile with ol.source.XYZ, such as in this example. new ol.layer.Tile({ source: ...

View answer
Getting full list of cities and regions from OSM
2 votes

You could use the useful OSM key [is_in=*] to get a list of the administrative regions where your place is situated. You can query the OSM data using the overpass API. You can output some data ...

View answer
Making base map from image with known corner coordinates?
Accepted answer
2 votes

In Openlayers 3 or 4, you can display an image as a base layer without depending on a WMS or a tile provider by using the ol.layer.Image constructor: var imageLayer = new ol.layer.Image({ ...

View answer
Color of extent in OpenLayers 3
Accepted answer
2 votes

See this example from the OpenLayers website and this question on SO: You have to define a style variable and bind it to your layer: var stroke = new ol.style.Stroke({ color: 'rgba(255, 204, 0, ...

View answer
Styling a contour line to indicate the direction of elevation
Accepted answer
1 votes

You are looking for the line-offset property of a Mapnik line symbolizer. This property allows to offset the lines by some pixels (so not geographically). For offsetting some lines by some ...

View answer
How to force ol3 map to immediately reload tiles from geoserver after a change?
1 votes

You should force the reload of the browser cache. In Google Chrome, you can do it: on demand by pressing CTRL+F5 (instead of simply pressing F5) or, permanently (in development) by checking the ...

View answer
Leaflet dynamic legend for active layer controls?
1 votes

There are some errors in your JS code. First, you define the function test(arr) with an argument but forgot to put this argument when you call the function test. Second, console.log print its ...

View answer
GeoJSON source to other vector source OL 3
1 votes

First, I would say that merging points (markers) and lines in the same layer is a weird idea and may be impossible (?). How could you define a style for this point-and-line layer if merged? Grouping ...

View answer
Using Web Mercator with OpenLayers
1 votes

Your map and your WMS layer are projected in Web Mercator (EPSG:900913). Therefore, it is normal that your WMS url bbox are 15028131.255,-5009377.085,20037508.34,0 instead of 15.255,-50.085,20.34,0. ...

View answer
How to create TOC icons from a geojson leaflet style
1 votes

You can build your own table of content programmatically in javascript. The idea is to loop over the layers and/or the layer features of your map and to add a corresponding item in a html div (#toc). ...

View answer
Optimal page layout with Leaflet
1 votes

Some times ago I developed a general responsive framework for my webmaps. It is based on Bootstrap and jQuery. You can find it here: https://github.com/nobohan/responsive-webmap The features of this ...

View answer
Show/filter features based on field value in Leaflet
Accepted answer
1 votes

You have to combine different stuffs. Here is a way to go: 1) The input search box: Add an input field in your HTML DOM and add an event listener or a function (addFeature(id)) to it. When the ...

View answer
Tile rendering time measurement in MapServer?
1 votes

For evaluating the rendering time, I usually use the "Network" tab of the Developer tool in Google Chrome (SHIFT + CTRL + I). When doing a mapserver request, you can see the time needed for each ...

View answer
Clicking to create multiple icons on map using OpenLayers 4?
1 votes

I found the issue. Actually you don't need to transform your point geometry from EPSG:4326 to EPSG:3857, since the map is already in EPSG:3857. As stated in the openlayers doc, the default projection ...

View answer
openlayers 3 how to get map scale using zoom level
1 votes

The easy thing you can do is to display a scale line, as demonstrated in this example. var scaleLineControl = new ol.control.ScaleLine(); Computing a correct fractional scale is quite complicated,...

View answer
OpenLayers 3: Zoom and center at map startup
Accepted answer
1 votes

From this discussion, it seems there is no event when the map is "ready" (at least for openlayers3). A solution is to add a map.setView() function to your geolocalisation layer: // Layout map ...

View answer
selecting contours based on zoom / elevation? mapserver, postgis, leaflet contours
1 votes

You need to perform some kind of map generalization. You may have two possibilities: 1) Generalize your data prior serving it to mapserver: Use a desktop GIS or some GIS library to generalize your ...

View answer
Openlayers 3 and map captions i18n
1 votes

In OpenStreetMap, place names can be edited in several languages. For instance, look at the capital of China, which is defined in OSM in hundreds of languages (see the name:en, name:fr, name:es, etc. ...

View answer
How to Merge polygons while zooming out using leaflet?
1 votes

I cannot see a solution to make it on the fly in Javascript. The key word is generalization. So I'd suggest to rather 1) create your generalized layers using some GIS tools and (2) to display them in ...

View answer