Quantcast
Channel: Question and Answer » leaflet
Browsing all 198 articles
Browse latest View live

Leaflet views: how to zoom on the marker while clicking on it in order to get...

I am using the module Leaflet and its sub-module “Leaflet views”" in order to get a map displaying markers based on taxonomy terms. I am able to show a popup displaying the term page while I click on a...

View Article


Image may be NSFW.
Clik here to view.

Error with Leaflet Routing Machine

I downloaded the Leaflet Routing Machine from https://github.com/perliedman/leaflet-routing-machine. Unzipped and opened the index.html in my browser to see how it looks, and got an error as shown in...

View Article


Leaflet: how can I update content of popup by jQuery

in my popup is a spinner with class=spinner and an empty container for addon informations. I want to hide after successful ajax. I want to add some html in a container. I tried this: ~~~...

View Article

leaflet behavior with js injector

I want to manipulate Leaflet behavior based on user events. I am using JS injector for a View in drupal 7. Something very simple like… (function ($) { Drupal.behaviors.leaflet= { attach: function...

View Article

How do I use Proj4Leaflet projections correctly?

I’m loading data layers from a WMS server into a Leaflet map, and I need to give the user a choice of projections. For the WMS server requests, I just need to change the CRS parameter to a different...

View Article


loading geojson in leaflet

I just added the geoJSON vector layer in leaflet for my hybrid mobile app using phonegap, the problem is that when I add the geoJSON file of size larger than 2mb the application crashes. What is the...

View Article

Leaflet: How to enable pan & zoom while GeoJSON still rendering?

I’ve overlaid a huge GeoJSON geometry on top of my Leaflet map, covering about 20 countries’ borderlines (about 1,5 million vertices) using “L.geoJson”. Each time I zoom in/out, the computer has to...

View Article

Image may be NSFW.
Clik here to view.

How can I make Leaflet tiles appear in a page?

I am having trouble with leaflet working, but not displaying any of the background tiles in the page. This one is using the leaflet-rails gem in a Rails app. This is just in an html sample page: I have...

View Article


How to use Leaflet to efficiently show parts of a massive dataset?

I keep seeing non-GIS web developers running into this problem, and I’m not sure what the solution is. There is some dataset of thousands of items. We want to show a map to the user, with the visible...

View Article


Increase marker size when zoom in on leaflet map

Been getting a really nice map with Leaflet but here is the problem. When I zoom into the map my markers keeps the same px width and height which is 9×9 and you can barely see them. Is there any way to...

View Article

How to add an attribution on a GeoJSON Layer from Leaflet?

I need to use a GeoJSON Layer on my Leaflet map. Here is a sample of my code: function onEachFeature(feature, layer) { if (feature.properties && feature.properties.popupContent) {...

View Article

What is the best way to handle metadata with TileStache?

When I’m serving up maps and UtfGrids with tileStache I would like to also include some metadata with the layers so that my leaflet application can understand the context of the layer. For example:...

View Article

Image may be NSFW.
Clik here to view.

hiding some “feature”s in GeoJSON file on map

I have geojson file including boundaries of most countries in world. When I clicked on a “feature” (aka country, or polygon) I want to hide it while keep showing the others. because I am planing to...

View Article


Image may be NSFW.
Clik here to view.

How to generate legend in leaflet webmap?

Although I have checked the “Create Legend” option in the qgis2leaf plugin, it did not generate any legend in the output webmap. What am I missing here ?

View Article

Image may be NSFW.
Clik here to view.

Stray horizontal lines after converting from GeoJSON to topojson

After converting a GeoJSON file to topojson, and loading the topojson into Leaflet, stray lines appear in the resulting map. Like this: What is causing this? If I view the GeoJSON, these stray lines do...

View Article


Geocoder leaflet for internal use in the company, which take addresses from...

I am making a personal application routing to be used internally in the company using machine leaflet route. The plugin uses nominatim geocoder, but he geocodificia according to the links of the OSM. I...

View Article

What is wrong with my data receiving from php script for geoJSON TileLayer?

I want to get geo data as geojson for geojson tile layer requests in leaflet. I set up a geojson layer like this: https://github.com/glenrobertson/leaflet-tilelayer-geojson/ A php script answers...

View Article


How do you load a GeoJSON file in Leaflet?

I’m stumped as to how to add a GeoJSON layer to an OSM map. Through Google, I’ve found a bunch of different answers, none of which seem to work. Following the Leaflet documentation, the simplest way to...

View Article

Displaying click results in a side panel

I am trying to do something similar to the interactive choropleth map (http://leafletjs.com/examples/choropleth.html) on leaflet’s website. In my case I want to use a click instead of a hover and want...

View Article

How to update leaflet L.imageOverlay using jquery serialize without page...

I am developing an application that fetches and displays raster/image maps (png, tif), into a leaflet map. However, I didn’t like the page and the map refresh upon form submission. In addition, I want...

View Article
Browsing all 198 articles
Browse latest View live