Skip to content

Commit

Permalink
Adding initial files
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtoye committed Jun 5, 2012
0 parents commit ed16e83
Show file tree
Hide file tree
Showing 10 changed files with 597 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
165 changes: 165 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@

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

*.pydevproject
.project
.metadata
bin/**
tmp/**
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


#############
## 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

# Mac crap
.DS_Store
69 changes: 69 additions & 0 deletions Control.PolyDraw.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/* Leaflet controls */

.leaflet-control-polydraw {
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
}
.leaflet-control-polydraw {
padding: 5px;
background: rgba(0, 0, 0, 0.25);
}
.leaflet-control-polydraw a {
background-color: rgba(255, 255, 255, 0.75);
}
.leaflet-control-polydraw a {
background-position: 50% 50%;
background-repeat: no-repeat;
display: block;
}
.leaflet-control-polydraw a {
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
width: 19px;
height: 19px;
margin-top: 5px;
}
.leaflet-control-polydraw a:first-child{
margin-top: 0;
}
.leaflet-control-polydraw a:hover {
background-color: #fff;
}
.leaflet-touch .leaflet-control-polydraw a {
width: 27px;
height: 27px;
}
.leaflet-control-polydraw-polyline {
background-image: url(images/polyline.png);
}
.leaflet-control-polydraw-polygon {
background-image: url(images/polygon.png);
}

.leaflet-cursor-label {
background-color: #fff;
border: 1px solid #ccc;
color: #999;
font: 12px/18px "Helvetica Neue", Arial, Helvetica, sans-serif;
margin-left: 20px;
margin-top: -21px;
padding: 2px 4px;
position: absolute;
white-space: nowrap;
z-index: 6;
}

.leaflet-cursor-label-latlng {
color: #222;
}

.leaflet-polyline-guide-dash {
background-color: #f06eaa;
font-size: 1%;
opacity: 0.6;
position: absolute;
width: 5px;
height: 5px;
}
54 changes: 54 additions & 0 deletions Control.PolyDraw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
L.Control.PolyDraw = L.Control.extend({
options: {
position: 'topleft',
drawPolyline: true,
drawPolygon: true
},

onAdd: function (map) {
var className = 'leaflet-control-polydraw',
container = L.DomUtil.create('div', className);

if(this.options.drawPolyline) {
this._createButton(
'Draw a polyline',
className + '-polyline',
container,
map.polyDraw.drawPolyline,
map.polyDraw
);
}

if(this.options.drawPolygon) {
this._createButton(
'Draw a polygon',
className + '-polygon',
container,
map.polyDraw.drawPolygon,
map.polyDraw
);
}

return container;
},

_createButton: function (title, className, container, fn, context) {
var link = L.DomUtil.create('a', className, container);
link.href = '#';
link.title = title;

L.DomEvent
.addListener(link, 'click', L.DomEvent.stopPropagation)
.addListener(link, 'click', L.DomEvent.preventDefault)
.addListener(link, 'click', fn, context);

return link;
}
});

L.Map.addInitHook(function () {
if (this.options.polyDrawControl) {
this.polyDrawControl = new L.Control.PolyDraw();
this.addControl(this.polyDrawControl);
}
});
Loading

0 comments on commit ed16e83

Please sign in to comment.