Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewrite with baselayers, and history #18

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
2b20429
added stateful hash
Jan 14, 2013
52afa5f
added gitignore
Jan 15, 2013
825d578
major rewrite
Jan 15, 2013
4ff7b30
touch up
Jan 15, 2013
cd88d34
updated cakefile
Jan 15, 2013
2b70104
updated readme
Jan 15, 2013
e49f99a
moved stuff
Jan 15, 2013
a937083
moved stuff
Jan 15, 2013
2175a06
added in @yohanboniface's change
Jan 15, 2013
88ea757
build
Jan 15, 2013
f01afce
updated cakefile
Jan 15, 2013
396001d
added @bryanbuchs custimizible hash idea
Jan 15, 2013
8f2d503
build @bryanbuch's custimizible hash idea
Jan 15, 2013
f4f6451
added @yohanboniface
Jan 15, 2013
92b7c3d
build
Jan 15, 2013
6b333a0
updated contributors
Jan 15, 2013
68b345d
layers
Jan 15, 2013
d1e2497
base layers, sorta
Jan 16, 2013
c88cb12
working base layer hash
Jan 16, 2013
0eb9cd7
Merge pull request #1 from calvinmetcalf/layers
Jan 16, 2013
bbc25bc
older ie layers
Jan 16, 2013
84e6520
build
Jan 16, 2013
7f8af00
code clean up
Jan 16, 2013
bad60c0
build
Jan 16, 2013
2f06b80
innerText not innerHTML
Jan 16, 2013
16fb13b
touch ups
Jan 16, 2013
2719b06
sane
Jan 17, 2013
8f072d5
dom
Jan 17, 2013
6a0d95d
0.1
Jan 17, 2013
d5d0c25
build
Jan 17, 2013
4e1896e
less wonky version
Jan 17, 2013
bb091e8
build
Jan 17, 2013
3545df3
removed console.log
Jan 17, 2013
c433921
layer in front by default
Jan 17, 2013
5883922
reformat
Jan 17, 2013
5575e14
reformat
Jan 17, 2013
139d8d4
reformat
Jan 17, 2013
9fffc72
build
Jan 17, 2013
2409341
updated readme
Jan 17, 2013
6e110f2
don't check for baselayer changes if no layercontrol
Jan 18, 2013
091de06
build
Jan 18, 2013
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.DS_Store
~*
.c9revisions
node_modules
24 changes: 24 additions & 0 deletions Cakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
fs = require 'fs'
coffee = require 'coffee-script'
uglifyjs = require 'uglify-js'

task 'build', 'build it', () ->
fs.readFile './src/leaflet.hash.coffee', 'utf8', (e,d)->
unless e
fs.writeFile './dist/leaflet.hash.js', coffee.compile d
console.log "compliled"

task 'min', 'build it small', () ->
fs.readFile './src/leaflet.hash.coffee', 'utf8', (e,d)->
unless e
j = coffee.compile d
ast = uglifyjs.parse j
ast.figure_out_scope();
ast.compute_char_frequency();
ast.mangle_names();
fs.writeFile './dist/leaflet.hash.min.js', ast.print_to_string()
console.log "minified"

task 'all', 'build it all', () ->
invoke 'build'
invoke 'min'
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,24 @@ You can view a demo of leaflet-hash at [mlevans.github.com/leaflet-hash/map.html

```javascript
// Assuming your map instance is in a variable called map
var hash = new L.Hash(map);
map.addHash();
```
4. optionally you can pass a an object with a few options
* lc: pass an instance of L.Control.Layer, the baselayers will be put in the hash
* path: template for the url hash, defaults to '{z}/{lat}/{lng}' or '{base}/{z}/{lat}/{lng}' if lc is specified, parts need to be seperated by "/"
* formatBase: an array of length 2 that will be used as the arguments of the overlay names before they go into the url hash, the default turns whitespace to underscores and all lowercase just pass "[//]" if you want it unchanged

### Hacking Around

1. Build with cake,

```bash
npm install #install dependencies
cake build #builds it regular
cake min #builds minified
cake all #does both
```
2. leaflet-hash.coffee is the file to modify.

### Author
[@mlevans](http://github.com/mlevans)
Expand Down
264 changes: 264 additions & 0 deletions dist/leaflet.hash.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/leaflet.hash.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading