• Stars
    star
    156
  • Rank 239,589 (Top 5 %)
  • Language
    JavaScript
  • Created almost 6 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This contains basic codes on leaflet programming. It includes some important plugins of leaflet & some other different technique for analysis the map.

Introduction

Checkout the playlist on leafletjs from basic to advance below,

  1. Leaflet from basic to advance
  2. Leaflet Crash course
  3. Advance spatial analysis in leaflet | turfjs
  4. What is GeoJSON, How to use, What is the important of GeoJSON? | geojson.io | mapshaper

This repo contain all the basic ideas about the leaflet. I added various functionalities about the leaflet.js.

Basic

Inside this folder I added following functionalities.

  • Adding base map
var map = L.map("map").setView([28.2521, 83.9774], 18);
var OpenStreetMap_Mapnik = L.tileLayer(
  "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
  {
    maxZoom: 19,
    attribution:
      '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
  }
).addTo(map);
Adding multiple base layers
var baseLayers = {
  "OSM Mapnik": osmMap,
  Landscape: landMap,
};

L.control.layers(baseLayers).addTo(map);
Adding multiple markers
var markers = [
  ["7C6B07", -40.99497, 174.50808],
  ["7C6B38", -41.30269, 173.63696],
  ["C820B6", -41.51285, 173.53274],
];
for (var i = 0; i < markers.length; i++) {
  marker = new L.marker([markers[i][1], markers[i][2]])
    .bindPopup(markers[i][0])
    .addTo(map);
}
Adding lines on leaflet map
var polyline = L.polyline(
  [
    [-40.286, 175.796],
    [-41.281, 176.086],
    [-41.279, 175.776],
    [-41.29, 174.075],
    [-42.292, 174.788],
  ],
  {
    color: "red",
    weight: 10,
    opacity: 0.7,
    dashArray: "20,15",
    lineJoin: "round",
  }
).addTo(map);

GeoJSON

Inside this folder I added following functionalities.

  • Adding Geojson in map
L.geoJSON(json_data).addTo(map);
  • Custom Popup in Geojson
  • Custom style in Geojson

Geolocation

Inside this folder, I write the code to redirect the user location. It takes the user location and shows on map.

Responsive sidebar for leaflet

This is actually a plugin. This plugin can be found at leaflet-sidebar-v2

Animation Routing

Inside this folder, I use leaflet-router-machine plugin. for more information goto leaflet-routing-machine

Draw

This is also a draw plugin. This plugin supports the Drawing feature in map. There are lots of features in this plugin. The user can add the point, line, polygons, edit this layers, delete the layer etc.

Leaflet Routing Machine

This plugin is very useful for the navigation. for more goto leaflet-routing-machine. This plugin can be initiated by using

<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<link rel="stylesheet" href="https://unpkg.com/leaflet-routing-machine@latest/dist/leaflet-routing-machine.css" />
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<script src="https://unpkg.com/leaflet-routing-machine@latest/dist/leaflet-routing-machine.js"></script>

mapbox base map

In this code, I use mapbox layer as base layer. The general style for showing the mapbox layer on leaflet is

var map = L.map("map").setView([28.2521, 83.9774], 12);
var mapboxTile = L.tileLayer(
  "https://api.tiles.mapbox.com/styles/v1/{username}/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}",
  {
    attribution:
      'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery Β© <a href="http://mapbox.com">Mapbox</a>',
    username: "iamtekson",
    id: "cjwhym7s70tae1co8zf17a3r5",
    accessToken:
      "pk.eyJ1IjoiaWFtdGVrc29uIiwiYSI6ImNqdjV4YzI4YjB0aXk0ZHBtNnVnNWxlM20ifQ.FjQJyCTodXASYtOK8IrLQA",
  }
).addTo(map);

Marker Cluster

The leaflet plugin named as marker-cluster is very useful for the multiple markers. This plugin helps to manage the multiple markers on the map.

More Repositories

1

leaflet-geoserver-request

This is the leaflet plugin for GeoServer. Using this plugin user can have access to wms and wfs request easily.
JavaScript
184
star
2

deep-learning-for-earth-observation

Application of deep learning for earth observation.
Jupyter Notebook
69
star
3

geodjango-from-dev-to-deployment

This is the repo for the course: "Web mapping and Web-GIS from Dev to Deploy 2021: GeoDjango".
JavaScript
50
star
4

leaflet-geojson-vt

Open-source library for loading the geojson vector tiles.
JavaScript
41
star
5

geotile

GeoTile is the python library for tiling the geographic raster data (eg. Tiff etc)
Python
36
star
6

awesome-geospatial-data-download-sites

This is the repo for open source geospatial data download sites.
30
star
7

landslide4sense-solution

This repo is the solution for landslide4Sense challenge.
Jupyter Notebook
27
star
8

geospatial-data-analysis-python

This repo contain the most common tools used in geospatial analysis using python!
Jupyter Notebook
24
star
9

geospatial-machine-learning

Machine learning in geospatial data
Jupyter Notebook
16
star
10

pySLD

The library is useful for generating the SLD file for raster as well as vector datasets. The package can generate 4 types of styles, Simple style, Categorized style, Classified style, Raster style.
Python
15
star
11

Deep-learning-for-satellite-imagery

This repo contains the code for satellite image analysis using deep learning.
Jupyter Notebook
15
star
12

DL-for-LULC-prediction

This is the ResNet50 implementation of the Eurosat dataset.
Jupyter Notebook
14
star
13

geodjango-udemy

This is the repo for udemy geodjango tutorial: Course link, https://www.udemy.com/course/introduction-to-web-mapping-and-web-gis-2020-geodjango/?referralCode=72E09BDD6D9C8ECE2169
JavaScript
12
star
14

GIS-portal

This is the repo for the Web GIS development 2021 course on udemy. Check out the course here: https://www.udemy.com/course/web-gis-development-2021/?referralCode=488F271341990F62FD05
JavaScript
11
star
15

geodjango-app

This is the simple geodjango app, in which user can add the locational information from django-admin and the location information will be shown in the homepage.
Python
10
star
16

leaflet-training

The leaflet part website is hosted here: https://iamtekson.github.io/leaflet-training/index.html
JavaScript
9
star
17

iamtekson

5
star
18

deep-housing-webGIS

This is our final year project named as "Web-GIS Based Utility Management System". The static page related to this project is find here:
TSQL
5
star
19

Geo-Cooker

ESRI Hackathon 2023
JavaScript
4
star
20

Online-house-purchasing-website

Django Real State website
CSS
4
star
21

WRC-webmap

JavaScript
4
star
22

json2Geojson

JavaScript
3
star
23

Web-GIS

This Web-GIS is hosted at
HTML
3
star
24

visit-nepal-2020

This repo is the initiation promotion of #Visit-Nepal-2020. I am trying to develop the tourism friendly web-app which will be helpful for making there plans.
JavaScript
2
star
25

simple-website-Geomapping

You can show the live preview of this page at:
HTML
2
star
26

map-generator

This is the simple choropleth map generator function using php and javascript.
JavaScript
2
star
27

My-protofolio-website

v1.0.0 note: This is just static website about myself. HTML, CSS, JS, Bootstrap is used for this project. v2.0.0 note: This is the website made by using JS and PHP (MySQL database).
PHP
2
star
28

geoserver-training

This repo contain the code during GeoServer training session 3 organized by GESAN and OSGeo Nepal
JavaScript
1
star
29

GLOF-simulation

The repository contain the GLOF methodology, code, literature review and steps to produce a result.
Jupyter Notebook
1
star
30

postgres-helper

Python
1
star
31

GESAN-Website

This is just a static website of "Geomatics Engineering Students' Association Nepal" made by using HTML, CSS, Js and Bootstrap.
CSS
1
star
32

web-map-template-for-utility-management

The following code is hosted at:
HTML
1
star