Skip to content

Commit

Permalink
Partial for Leaflet#603
Browse files Browse the repository at this point in the history
- Move documentation css to src
- Declare built (dist) files for publish
- Add tests for GeometryUtil.readableDistance
- Add documentation for GeometryUtil, LatLngUtil, Utill, L.Polyline
- Simplified .gitignore
- Cleaned package.json order

TODO:
Add conversions to Polyline, Circle
  • Loading branch information
Jon West committed Nov 30, 2016
1 parent 7bb3e6f commit 845a016
Show file tree
Hide file tree
Showing 17 changed files with 225 additions and 332 deletions.
183 changes: 15 additions & 168 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,170 +1,17 @@

#################
## Eclipse
#################

*.pydevproject
.project
.metadata
bin/**
tmp/**
node_modules
.DS_Store
tmp/**/*
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath


#################
## Visual Studio
#################

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results
**/[Dd]ebug/
**/[Rr]elease/
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.vspscc
.builds
**/*.dotCover

## TODO: If you have NuGet Package Restore enabled, uncomment this
#**/packages/

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf

# Visual Studio profiler
*.psess
*.vsp

# ReSharper is a .NET coding add-in
_ReSharper*

# Installshield output folder
[Ee]xpress

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish

# Others
[Bb]in
[Oo]bj
sql
TestResults
*.Cache
ClientBin
stylecop.*
~$*
*.dbmdl
Generated_Code #added for RIA/Silverlight projects

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML



############
## Windows
############

# Windows image file caches
Thumbs.db

# Folder config file
Desktop.ini

# Node modules used during build
node_modules/

#############
## Python
#############

*.py[co]

# Packages
*.egg
*.egg-info
#dist
#build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox

#Translations
*.mo

#Mr Developer
.mr.developer.cfg

#Intellij
.idea

# Mac crap
.DS_Store
*.iml
_site
*.sublime-*
dist/*.js
dist/*.css
dist/*.map
coverage/
*.js.html
.mailmap
bower.json
component.json
debug/local/
Gemfile.lock
4 changes: 2 additions & 2 deletions build/leafdoc-templates/html.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<script src="./examples/libs/leaflet-src.js"></script>
<link rel="stylesheet" href="./examples/libs/leaflet.css"/>

<script src="../dist/leaflet.draw.js"></script>
<link rel="stylesheet" href="../dist/leaflet.draw.css"/>
<script src="../src/leaflet.draw.js"></script>
<link rel="stylesheet" href="../src/leaflet.draw.css"/>
</head>
<body class='api-page'>
<div class='container'>
Expand Down
9 changes: 8 additions & 1 deletion build/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ git checkout -b build
jake build[,,true]
jake docs

git add -A
git add \
dist/leaflet.draw.js \
dist/leaflet.draw-src.js \
dist/leaflet.draw-src.map \
dist/leaflet.draw.css \
dist/leaflet.draw-src.css \
docs/* \
-f

git commit -m "v$VERSION"

Expand Down
2 changes: 1 addition & 1 deletion docs/examples-0.7.x/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Leaflet.draw drawing and editing tools</title>

<link rel="stylesheet" href="libs/leaflet.css" />
<link rel="stylesheet" href="../../dist/leaflet.draw.css" />
<link rel="stylesheet" href="../../src/leaflet.draw.css" />

<script src="libs/leaflet-src.js"></script>

Expand Down
124 changes: 62 additions & 62 deletions docs/examples-0.7.x/full.html
Original file line number Diff line number Diff line change
@@ -1,83 +1,83 @@
<!DOCTYPE html>
<html>
<head>
<title>Leaflet.draw vector editing handlers</title>
<title>Leaflet.draw vector editing handlers</title>

<script src="libs/leaflet-src.js"></script>
<link rel="stylesheet" href="libs/leaflet.css" />
<script src="libs/leaflet-src.js"></script>
<link rel="stylesheet" href="libs/leaflet.css"/>

<script src="../../src/Leaflet.draw.js"></script>
<script src="../../src/Leaflet.draw.js"></script>
<script src="../../src/Leaflet.Draw.Event.js"></script>
<link rel="stylesheet" href="../../dist/leaflet.draw.css" />
<link rel="stylesheet" href="../../src/leaflet.draw.css"/>

<script src="../../src/Toolbar.js"></script>
<script src="../../src/Tooltip.js"></script>
<script src="../../src/Toolbar.js"></script>
<script src="../../src/Tooltip.js"></script>

<script src="../../src/ext/GeometryUtil.js"></script>
<script src="../../src/ext/LatLngUtil.js"></script>
<script src="../../src/ext/LineUtil.Intersect.js"></script>
<script src="../../src/ext/Polygon.Intersect.js"></script>
<script src="../../src/ext/Polyline.Intersect.js"></script>
<script src="../../src/ext/TouchEvents.js"></script>
<script src="../../src/ext/GeometryUtil.js"></script>
<script src="../../src/ext/LatLngUtil.js"></script>
<script src="../../src/ext/LineUtil.Intersect.js"></script>
<script src="../../src/ext/Polygon.Intersect.js"></script>
<script src="../../src/ext/Polyline.Intersect.js"></script>
<script src="../../src/ext/TouchEvents.js"></script>

<script src="../../src/draw/DrawToolbar.js"></script>
<script src="../../src/draw/handler/Draw.Feature.js"></script>
<script src="../../src/draw/handler/Draw.SimpleShape.js"></script>
<script src="../../src/draw/handler/Draw.Polyline.js"></script>
<script src="../../src/draw/handler/Draw.Circle.js"></script>
<script src="../../src/draw/handler/Draw.Marker.js"></script>
<script src="../../src/draw/handler/Draw.Polygon.js"></script>
<script src="../../src/draw/handler/Draw.Rectangle.js"></script>
<script src="../../src/draw/DrawToolbar.js"></script>
<script src="../../src/draw/handler/Draw.Feature.js"></script>
<script src="../../src/draw/handler/Draw.SimpleShape.js"></script>
<script src="../../src/draw/handler/Draw.Polyline.js"></script>
<script src="../../src/draw/handler/Draw.Circle.js"></script>
<script src="../../src/draw/handler/Draw.Marker.js"></script>
<script src="../../src/draw/handler/Draw.Polygon.js"></script>
<script src="../../src/draw/handler/Draw.Rectangle.js"></script>


<script src="../../src/edit/EditToolbar.js"></script>
<script src="../../src/edit/handler/EditToolbar.Edit.js"></script>
<script src="../../src/edit/handler/EditToolbar.Delete.js"></script>
<script src="../../src/edit/EditToolbar.js"></script>
<script src="../../src/edit/handler/EditToolbar.Edit.js"></script>
<script src="../../src/edit/handler/EditToolbar.Delete.js"></script>

<script src="../../src/Control.Draw.js"></script>
<script src="../../src/Control.Draw.js"></script>

<script src="../../src/edit/handler/Edit.Poly.js"></script>
<script src="../../src/edit/handler/Edit.SimpleShape.js"></script>
<script src="../../src/edit/handler/Edit.Circle.js"></script>
<script src="../../src/edit/handler/Edit.Rectangle.js"></script>
<script src="../../src/edit/handler/Edit.Marker.js"></script>
<script src="../../src/edit/handler/Edit.Poly.js"></script>
<script src="../../src/edit/handler/Edit.SimpleShape.js"></script>
<script src="../../src/edit/handler/Edit.Circle.js"></script>
<script src="../../src/edit/handler/Edit.Rectangle.js"></script>
<script src="../../src/edit/handler/Edit.Marker.js"></script>
</head>
<body>
<div id="map" style="width: 800px; height: 600px; border: 1px solid #ccc"></div>
<div id="map" style="width: 800px; height: 600px; border: 1px solid #ccc"></div>

<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
map = new L.Map('map', {center: new L.LatLng(51.505, -0.04), zoom: 13}),
drawnItems = L.featureGroup().addTo(map);
L.control.layers({
'osm':osm.addTo(map),
"google": L.tileLayer('http://www.google.cn/maps/vt?lyrs=s@189&gl=cn&x={x}&y={y}&z={z}', {
attribution: 'google'
})
}, {'drawlayer':drawnItems}, { position: 'topleft', collapsed: false }).addTo(map);
map.addControl(new L.Control.Draw({
edit: {
featureGroup: drawnItems,
poly : {
allowIntersection : false
}
},
draw: {
polygon : {
allowIntersection: false,
showArea:true
}
}
}));
<script>
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, { maxZoom: 18, attribution: osmAttrib }),
map = new L.Map('map', { center: new L.LatLng(51.505, -0.04), zoom: 13 }),
drawnItems = L.featureGroup().addTo(map);
L.control.layers({
'osm': osm.addTo(map),
"google": L.tileLayer('http://www.google.cn/maps/vt?lyrs=s@189&gl=cn&x={x}&y={y}&z={z}', {
attribution: 'google'
})
}, { 'drawlayer': drawnItems }, { position: 'topleft', collapsed: false }).addTo(map);
map.addControl(new L.Control.Draw({
edit: {
featureGroup: drawnItems,
poly: {
allowIntersection: false
}
},
draw: {
polygon: {
allowIntersection: false,
showArea: true
}
}
}));

map.on(L.Draw.Event.CREATED, function(event) {
var layer = event.layer;
map.on(L.Draw.Event.CREATED, function (event) {
var layer = event.layer;

drawnItems.addLayer(layer);
});
drawnItems.addLayer(layer);
});

</script>
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion docs/examples-0.7.x/snapping.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Leaflet.draw drawing with snapping</title>

<link rel="stylesheet" href="libs/leaflet.css" />
<link rel="stylesheet" href="../../dist/leaflet.draw.css" />
<link rel="stylesheet" href="../../src/leaflet.draw.css" />

<script src="libs/leaflet-src.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
crossorigin="anonymous"></script>

<link rel="stylesheet" href="libs/leaflet.css"/>
<link rel="stylesheet" href="../../dist/leaflet.draw.css"/>
<link rel="stylesheet" href="../../src/leaflet.draw.css"/>

<script src="libs/leaflet-src.js"></script>

Expand Down
Loading

0 comments on commit 845a016

Please sign in to comment.