Setting map language to English in Openstreetmap with LeafletJS

The standard tile server of OSM tries to display labels in the local language whenever such data is available (local meaning the language of the country currently displayed, not your local language). The tiles, served by the tile server, already contain the labels, so you cannot remove them afterwards. But you can: render them on … Read more

Get address from co-ordinates using OpenStreetMap [closed]

There are multiple reverse geocoding APIs available for OpenStreetMap (since the data is open-source, anyone can build one). The two that I would recommend you investigate further are: Nominatim, run by a member of the OSM community as a volunteer project. Reverse Geocoding documentation CloudMade Geocoding, run as a commercial service. Reverse Geocoding documentation (at … Read more

update marker location with leaflet API

The code inside your question is a little bit confusing, it’s hard to say what the issue is when you only post snippets. As it is, this code: var lat = (e.latlng.lat); var lng = (e.latlng.lng); var newLatLng = new L.LatLng(lat, lng); marker.setLatLng(newLatLng); ..should work as expected inside onLocationFound(). You can simplify it: marker.setLatLng(e.latlng); However, … Read more

Can I prevent panning Leaflet map out of the world’s edge?

Leaflet allows you to control how much the map resists being dragged out of bounds with the maxBoundsViscosity option (value: 0 to 1). Setting it to maximum disables dragging out of bounds entirely. var map = new L.Map(‘map’, { center: bounds.getCenter(), zoom: 5, layers: [osm], maxBounds: bounds, maxBoundsViscosity: 1.0 }); This feature is available in … Read more

Leaflet.draw mapping: How to initiate the draw function without toolbar?

This simple code works for me: new L.Draw.Polyline(map, drawControl.options.polyline).enable(); Just put it into the onclick handler of your custom button (or wherever you want). The variables map and drawControl are references to your leaflet map and draw control. Diving into the source code (leaflet.draw-src.js) you can find the functions to draw the other elements and … Read more

Leaflet map not displayed properly inside tabbed panel

It’s a complete hack from messing with the leaflet.js source code, but it works (at least in jsFiddle) http://jsfiddle.net/C7Rp8/4/ The idea is from Google Maps, to “resize” or “redraw” the map when its container div is resized. The changes I made are: add id link3 to the small tab in HTML <a href=”#lC” data-toggle=”tab” id=”link3″>tab3</a> … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)