forked from jQueryGeo/geo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev-journal-ryan.txt
1444 lines (1019 loc) · 94.1 KB
/
dev-journal-ryan.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
== to do ==
=== b1 ===
* docs - geomap - dragBbox mode
* geomap - dragBbox mode
* docs - geomap - shift option (default, zoom, shape, off)
* geomap - shift option (default, zoom, shape, off)
* docs - geomap - loadstart event
* geomap - loadstart event
* docs - geomap - loadend event
* geomap - loadend event
* docs - geomap - allow append to take an array of shapes
* geomap - allow append to take an array of shapes
* docs - geomap - allow remove to take an array of shapes
* geomap - allow remove to take an array of shapes
* docs - geomap - add argument to refresh to force reload of images (in case of dynamic data)
* geomap - add argument to refresh to force reload of images (in case of dynamic data)
* docs - geomap - zoomMax option (tiled & shingled)
* geomap - zoomMax option
* geomap - cache label coordinates (the labelPixel cannot be cached, it will change each refresh)
* geomap - rotate label based on segment
* geomap - use pointer-events: none where appropriate
* geomap - test changing shingled service URL to get updated images (in case of dynamic data)
* geomap - replace data-geo attributes with classes
* geomap - don't redraw graphics if the map doesn't move during pan
* geographics - draw all labels to a string or document fragment and append to DOM once
* geomap - compile shingled & tiled string src templates for re-use
** be sure their template names are unique so they don't overwrite each other
* docs - warn users about potential CSS/JavaScript issues relating to generated elements:
** ul, li, div, span, img
* geomap - [bug] pinch-zoom doesn't follow user's fingers close enough when scaling
* docs - geomap - describe "graphic service" as shingled with src set to empty string or null
* geomap - [bug] errors when setting src to empty string
** "When I added services for my graphics layers with src set to an empty string I got very weird results -- I was seeing the single image from my inset map repeated over and over. I had to set it to a function that returns an empty string for it to work."
** possibly an object reference error when multiple maps are created
* geomap - [bug] if panning is false, mode is draw*, and user attempts to pan, the drawing begins (or another point is added) on the touchstop point
** a failed pan shouldn't add a point to drawCoords
* geomap - Firefox - [bug] inertial pan is choppy post touchstop
* geomap - iPad 2 - [bug] pointAlong doesn't take last point into account in all browsers
** cannot reproduce; possibly axisLayout image only
* geomap - ie - [bug] ie highlights entire map div during shift-zoom
* geomap - [bug] iPad 2 panning is visually jumpy but settles on the correct bbox in the end
** possibly only when axisLayout is image
* geomap - [bug] iPad 2 measureLength puts current length on second to last coord instead of last coord
* geomap - [bug] pinch zoom on iPad 2 (iOS 5) doesn't refresh tiles when zooming out
** oddly, iPod Touch 4 (iOS 4) is fine
* geomap - [bug] first use of mouse/touch in any mode moves map by one pixel on mousedown/touch
** possibly only when axisLayout is image
* geomap - [bug] multiples of the same event trigger after creating more than one map on the same div, even after destroy
** destroy should unbind all geomap events
* geomap - remove this-style state properties
* geomap - remove "px" from .css calls
* geo - use Array.push instead of $.merge where needed
* geomap - [bug] changing services array (without changing all services) after initialization fails
* geomap - [bug] multiple maps do not work on the same page
* docs - upgrade to jQuery Mobile 1.0.1
* docs - non-mobile version via adaptive check
* geomap - create _defaultState object, use for widget-local _widgetState property, reinit _widgetState on _createWidget
* geomap - don't redraw shapes after interactiveScale, they've already been drawn at new scale
* geomap - [bug] exception when calling destroy on uninitialized div
* geomap - maybe throw an error when setting center to an invalid object, such as the first number in a coordinate array: coordinates[ 0 ] <== wrong!
* geomap - merge interactive pan and zoom into one, faster system (pan/zoom rewrite)
** pan and zoom in same interactive session (_interactiveCenter & _interactivePixelSize)
** delay image loading more during movement
* geomap - request new image in shingled service during interactive pan (after pan/zoom rewrite)
* docs - geomap - view.service.row & view.service.column to string multiple services together or repeat horizontal tiles
* geomap - view.service.row & view.service.column to string multiple services together or repeat horizontal tiles
* geomap - repeat horizontal tiles
* geomap - don't request tiles that > max possible y for scale
* geomap - do not interactiveScale non-tiled maps out past pixelSizeMax
* geomap - [bug] zoom in more than once with zoom method moves tiles to the wrong spot
** postponed until after pan/zoom rewrite
* geomap - [bug] only services that have finished refreshing move when the user pans
** check by zooming in then panning shingled demo with forest layer on
** for a4: hide unfinished services; for b1: properly move the already zoomed service after pan/zoom rewrite
* geomap - [bug] map panning is jumpy, appears to be related to shapes and/or drawing context
** postponed until after pan/zoom rewrite
* geomap - [bug] pan sometimes lags on first drag
** cannot reproduce effectively, test again after pan/zoom rewrite
* geomap - use CSS transition or transform for smoother tiling
* geomap - implement service-level shape redrawing during interactive movement
* examples - jQuery Mobile
* examples - MBCR: http://www.mbta.com/rider_tools/developers/default.asp?id=21899
* examples - drag shapes
* examples - ie7 - [bug] floating info div doesn't show up, inputs are alone and on the left
* examples - redo the jVectorMap demo page using jQuery Geo
* examples - make OSM editing simple
** http://www.maploser.com/2012/03/29/all-i-want-for-openstreetmap-is-simple/
** http://jvectormap.owl-hollow.net/ ( found via http://www.moretechtips.net/2011/12/22-most-popular-jquery-plugins-of-2011.html )
* expose jQuery Geo as an AMD module so asynchronous loaders like RequireJS and curl.js can use it
* examples - geomap resize method
* examples - Codecademy course
* geomap - [bug] when a singled image hasn't loaded after pan and you double click on empty space, the zoomed bbox seems wrong
* cdn - test cache headers with http://redbot.org/ before release
=== future ===
* docs - geomap - pass the service id (if there is one) to the src callback as a view property
* geomap - pass the service id (if there is one) to the src callback as a view property
* docs - geomap - support dynamic map services that only work in geodetic coordinates (sr=4326)?
** can be done with src function that uses $.geo.toGeodetic?
* geomap - support dynamic map services that only work in geodetic coordinates (sr=4326)?
* docs - geomap - pan events (pattern after HTML5 drag)
** can cancel with preventDefault
* docs - geomap - zoom events (pattern after HTML5 drag)
** can cancel with preventDefault
* docs - geomap - support two-finger vertical slide as zoom on mobile devices
* geomap - pan events (pattern after HTML5 drag)
* geomap - zoom events (pattern after HTML5 drag)
* geomap - test jQuery widget call chaining when setting option values
* geomap - when scroll is zoom, attempt to not zoom while user is scrolling the page anyway
* geomap - allow src to return a callback function or Promise to delay image requests for some reason (multiple requests, etc.)
* docs - geomap - document the correct way to add a service after init
* geomap - remember last map unit type set with bbox and center, return all coords and arguments in that type
* geomap - unbind keydown handler on destroy, it's on the document
* docs - $.geo.WKT object
* geo - $.geo.WKT object
* geomap - panning cursor (for when user is actually panning)
* geomap - completely original cursor set for pan, zoom, draw, etc.
* docs - geomap - replace method
* geomap - replace method
* docs - geomap - allow service-level refresh
* geomap - allow service-level refresh
* geomap - reenable graphics redraw on interactiveScale, if canvas...and scale canvas
* docs & examples - settle on the word "option" in all text (instead of property) to match widget function
* docs - make all map examples live
* docs - explain the 96px scale bar, why 96?
* docs - write a full page about GeoJSON and what each object type is to $.geo
* docs - geomap - allow name as service object property
** if a service has a name property, it will maintain a hidden input with the given name
* docs - geo - support up to GeometryCollection in distance
* geo - support up to GeometryCollection in distance
* docs - geo - support up to GeometryCollection in contains
* geo - support up to GeometryCollection in contains
* docs - geo - support up to GeometryCollection in centroid
* geo - support up to GeometryCollection in centroid
* geomap - stop using $.data to store bbox since it's only used for drawing; store on _graphicShapes instead
* geomap - show a drawPoint style while the mouse is down, hide if toolPan or dbltap scale
* geomap - android - [bug] cannot always pan map after appending shapes
* geomap - audit allocations and reduce garbage
** see http://www.scirra.com/blog/76/how-to-write-low-garbage-real-time-javascript
* geomap - re-use services that have the same id as existing services
* geomap - deep extend existing service objects when services property is set
* geomap - cache point bbox if $.geo.proj is not null?
* geomap - spatially index shapes when a tilingScheme is in place
* geomap - internal - add _getVisibleTiles method and use it in tiled service and shapes spatial index
* geomap - remove wheel plugin and use built-in mousewheel event
* geomap - test how the comma selector works with the find method
* geomap - compile service src templates, refresh when services changes
* code - prefer $.data over $.fn.data
* docs - internal - explain what projection is and which one we use by default (3395) and maybe why we call it web mercator & why we can't get to +/- 90 lat
* docs - internal - document how geomap draws shapes, the geomapgraphics widget and the reason shapeStyle is a method
* docs - demo - location based notes/to do list
* geomap - label divs should have class="geo-label" & style="position: relative;"
* geomap - find should check labels first
* geo - geometry - implement JTS note: "The centroid is equal to the centroid of the set of component Geometries of highest dimension (since the lower-dimension geometries contribute zero "weight" to the centroid)"
* geo - Support WKT with $.geo.parseWKT & $.geo.textify
* geo - All bbox operations should be done in non-geodetic coordinates for accuracy
* geo - support bbox in distance ( fix geomap.find )
* docs - geomap - shapeLabel property
** template for labels for all shapes added via append
* geomap - perf test putting all containers that need to move with panning in a single super-container
* docs - geomap - multiple labels
* geomap - multiple labels
* geomap - [bug] mouse wheel on bad or missing tile doesn't zoom out on first rotate
* docs/geomap - store WKT input for each service
* geographics - rename the generated style properties to something simple or get better control over closure compiler
* geomap - document and implement find's callback syntax
* geomap - repeat horizontal tiles
* geomap - custering demo/support
* proj - take scale factor into account when calculating distance in web mercator
* geographics - Disable fill by setting style.fill to "" & stroke by style.stroke to ""
* graphics - See Modernizr for comment on BB Storm & canvas detection
* geographics - document graphics widget
* geographics - support border, padding, and margin
* geographics - undo manual outer div style changes
* geomap - [BUG] Android browser stops pan/zoom after 7 logos on logo demo
* geomap - store a copy of shapes as WKT in a hidden input
* geomap - only update WKT copy if shape is appended with refresh argument set to true
* geomap - find - [maybe] after flatten, check more cached bboxes for non-Point geometrie
* docs - geomap - support TMS
* geomap - support TMS
* docs - geomap - toDataURL method
* geomap - toDataURL method
* docs - geomap - SVG & other neat elements/media in labels
* docs - geo - $.geo.guessLocation function
* geo - $.geo.guessLocation function
* docs - services - document the plugin architecture
** create must return a jQuery collection where geomap can store state info
* docs - geomap - drawPush function
** in the drawing modes, this function starts drawing or adds a point into the already-started shape at the given coordinate
** immediately triggers the shape event if mode is drawPoint
* geomap - drawPush function
* docs - geomap - drawPop function
** in the drawing modes, this function ends drawing or removes a point into the already-started shape at the given coordinate
* geomap - drawPop function
* docs - geomap - drawStop function
** in the drawing modes, this function ends drawing and triggers the shape event with whatever coordinates have already been added to the shape
* geomap - drawStop
* geomap - use profiling to improve pan performance
* geo - potentially add address cracking
==2012-03-30==
===grunt===
I haven't written in a while. Checking out grunt now.
Wow, that was cool. jQuery Geo now compiles with Grunt and I also have a jQuery plugin package file!
===graphic holes===
With canvas, I have better control of drawing polygons with holes. It's pretty nice. I can't wait to get into WebGL.
==2012-02-15==
===labels===
The code already worked the way I wanted! No .geo-label div is created if you don't at least provide an empty string label.
==2012-02-12==
===find===
Need to implement the * selector. That was easy. $.isPlainObject thankfully returns false on strings.
===unloaded image===
It appears that when you pan starting on an area that has an unloaded image, i.e., empty space, this._center gets set to string values. Checking on this now.
===shingled 0===
To prohibit shingled maps from zooming out past 0, I had to change quite a bit of code. I now have getZoom & getPixelSize methods that will work regardless of tilingScheme. I'm also calculating pixelSizeMax when bboxMax changes and making sure the non-tiled zoom doesn't go less than 0 in two spots. That seems to do the trick.
===service-level shape refresh===
Shapes on services draw twice, heh. That was a tough one. Turns out, when I create the service-level geomap widgets, I wasn't setting _graphicShapes to a new array before passing the (this) object to the widget factory. All services were sharing the same _graphicShapes reference.
==2012-02-11==
===current services===
I need to make sure their style property is always full, that's the point of having an internal copy. This means I have to fill in visibility & opacity when I create the services based on defaults.
=== service style===
$.extend({
visibility: "visible",
opacity: 1
}, style)
That returns what you would expect if style is undfined.
===str src===
I can't mod index in the template. I feel that there is a way, but it's not there yet.
==2012-02-06==
===mousewheel===
This needs to be updated, it doesn't work with jQuery 1.7.
==2012-02-04==
===options===
Right, this._options does equal this.options but only because the latter must be called so and we can minify the former for internal use.
==2012-02-03==
===proj===
I seem to be able to detect geodetic coordinates ok. I'm switching all of the $.geo functions to use it. So far, so good.
==2012-02-02==
===transition===
They look cool, but I don't think this project is ready for transitions, they have some unexpected side-effects. I would like to rewrite the interactive portion anyway.
==2012-02-01==
===destroy===
There's a bug with shingled services if I call destroy and try to re-create.
===services===
Changing the services option will destroy all service-level shapes. I'm not sure what to do about that. Eventually, I will re-use serviceContainers (and service-geomaps) based on the new services array coming in but I currently don't do that.
===proj===
Finally, to get rid of proj. The point is, you should be able to use projected coordinates even when $.geo.proj is not null.
The same geodetic test applies to both bbox & coords because the first two elements of either are the x and y of some number. Nice!
==2012-01-31==
===shapes zoom===
Service-level shapes don't refresh while zooming and it's not going to be easy at the moment. All I can do is call geomap("refresh") on the serviceContainer which, since they're just service pseduo-map widgets, will only refresh the shapes. The problem is they don't have access to the in-between state of the zoom so the shapes don't draw correctly. I will fix this later when I re-invent the pan/zoom code for beta. For now, service-level shapes will not draw during interactive zoom.
However, it's good to have an idea of how the new system will need to work. Each service-map widget will check the _interactiveCenter & _interactivePixelSize values to draw shapes in proper positions.
==2012-01-30==
===geographics===
This widget needs some updates. For now, I'm just going to add the resize function.
Note, with canvas, you don't need to set size CSS at all. The canvas is, by default, inline-block with width and height based on the html element attributes. Also, as is shown in this fiddle, changing the runtime width & height properties of the canvas element does clear the canvas: http://jsfiddle.net/jcGY2/
==2012-01-28==
===service-level shapes===
Where was I before I stopped to add Deferred & fix bugs? Right. The service-level geomap widgets should now initialize their own shapesContainer.
===resize===
resize is a method on the service object because shingled need to stretch the current image.
I need to finally add resize to geographics.
===find===
find will have to query and include service level shapes.
===map===
This will be simpler if I allow services to get to the private map variables (similar to how I allow the service object to do it?). No, probably during create.
Can you have protected properties in a jQuery UI widget? I would like to be able to pass a reference to the map during create...I could also use .data. That worked fine. I now have this._map which will be the same as this for the map object and a reference to the map object for services. Nice! On parts that need to work the same between maps and services, (such as _refreshShapes), I can just call this._map.x and it will be correct.
===shapeStyle===
This should be fine for services.
==2012-01-27==
===Deferred===
The src function will be allowed to return a Deferred (or Promise) object. If it does, geomap will wait for the done or fail events. The src function will call resolve or fail.
===service shapes===
The opacity method might have to stay as a service method because it must directly manipulate image elements in some cases. However, the toggle method can operate on the new service container.
===init services===
So, the jQuery UI widget factory udpates non-array options fine, i.e., when I get into the _create method, this.options has whatever the user supplied merged in with the default options. However, array options are not copied so any changes to the initial service option are not maintained.
Not true, but it does unfortunately merge the first user supplied service with the default service, osm.
===options===
I forget why I have _options and options. They are supposed to be internal vs exteternal but they are equal references.
==2012-01-24==
===a4===
What's next for a4? static mode.
===static mode===
This shouldn't be too hard. Currently, any non-defined mode string will act close to static. That's different from how I want it to work. The mode "static" should be static and undefined modes should act like pan for now.
The switch appears to have gone well. I can set the mode to "23" and it acts like it's in pan. That's a feature I will define more fully later and document before it's official.
===labels===
Time to merge labels into geographics. This is a huge step toward service-level shapes. I should be able to find all $labelsContainer references and move them into sections of geographics.
Now that labelsContainer is part of shapesContainer, the next step is to put shapesContainer under a serviceContainer (which is inside servicesContainer). Got that?
===service-level shapes===
Here we go! Each serviceContainer has a div that contains all the images. The geographics widget will be a sibling of that.
I may need a new container :/ the extra div was the tiled service's scale container. I need a container for the service/graphics elements.
The map itself will have to manage this new container. I think the internal service objects will get this container and now append their functionality and elements to it. It will no longer have to return a new div for which the map will create a sub-geomap.
==2012-01-23==
===addressing===
I think address parsing (cracking) will be a useful feature for geocoding to non-Google geocoders. I might want to add that to $.geo at some point. Christian has some Python code that does it already I can port.
==2012-01-21==
===pinch aftermath===
Adding pinch was pretty easy. The only big issue was if a second finger touched a short time after the first. To counter, I fake as if all touch has stopped and initiate a new one. There's room to consolidate code here but I'll get to that later.
===drawPoint===
This acted funny with pinch zoom in that when the second finger hit late, a shape event got triggered at the first finger.
===draw other===
Similar issue, touchstop gets triggered after pinch zoom and a segment is added to the shape. Maybe related to calling touchstop. We get in an odd state, actually. The segment shows up but the next touch causes it to disappear and a new one appear instead.
I'm going to put this as a bug and get back to it later. There's much more actual functionality to get into alpha 4.
==2012-01-20==
===pinch===
This is mostly ready for iOS. It's a little jumpy so I think I have to detect a second touch while the first one is down as long as they haven't started panning yet and move into pinch zoom.
If the second finger is late, we still only get the touchmove event which will work great.
===android===
I am going to coin "hold scroll" for android to counter their lack of multitouch. When the user holds the map in the same place for between .5 seconds and before the browser takes over, the user can move the touch point vertically to start zooming as if there's a scroll wheel.
I was going to have "expand zoom" (coined by Laura) where it works similar to "hold scroll" but instead of acting like a scroll wheel, it acted like the bbox was expanding from the hold position. In effect, a zoom in only fake pinch zoom. However, I like the zoom in/out ability of the fake wheel better. This will also work on iOS, I think and even desktop.
===web workers===
I eventually want the $.geo functions to allow the browser to use web workers but they'll have to be in a javascript file. Hopefully, I can use data URIs.
I could always grab the worker js from the CDN but that would require internet access. What if it's all an internal site, like for government. Or, graphics only that doesn't need servers.
I can use data URIs but I wasn't able to have a local variable in the function. You can, but you need all %20's instead of spaces.
==2012-01-17==
===geomapshape===
May be getting multiple shape events when in drawPoint mode and attached via bind("geomapshape").
Not just shape, all events. If you recreate a map on the same div & rebind an event to a new function, it will trigger more than once.
===wkt===
While not in this release, I have a need to fix WKT parsing. Finished parse LineString & (single ring) Polygons.
===pinch===
Next on the list is pinch zoom. I can hook this into the scroll zoom mechanics based on pinch center & ratio of initial pinch bbox to current pinch bbox to scale the tiles.
Initially, I'm going to jump one scale level (or scale ratio) like wheel zoom. Later, when I update the whole interactive movement engine, I'm going to transition to the next scale level.
This will tap into the _wheelLevel variable, which I should possibly rename later.
Dropping out of multitouch (lifting one finger) will end interactive zoom & call setCenterAndZoom.
We pick the largest ratio between x & y changes.
==2012-01-16==
===zoom===
Accidentally moved some code to where it didn't belong & broke interactive zoom. Fixed.
==2012-01-12==
===getUrl===
I would like to further have the service object's properties match html rather than css. I might rename this to just src.
==2012-01-11==
===scroll & drag===
I need options to disable the default behavior of scrolling and dragging.
===html attr===
I think my options should reflect more like HTMl attributes than css properties. Including service object options. That might make me change visibility back to visible :( At least I'm not beta yet.
Scratch that, it's a presentation option and all presentation options should follow CSS. However, I may move it to a style property of the service object. Are there other style properties?
Only opacity.
===scroll===
I would like to support two-finger vertical slide as zoom on mobile devices but I'm not ready to write that up yet.
Hmm. Can I handle scroll without an option? I can detect page scrolling and set a timeout. If the user has been scrolling the page, we don't want to scroll the map. But, what if the user's cursor just happens to be on the map when they want to scroll the page. I'm keeping scroll, the developer should have control to turn it off all together.
==2012-01-2==
===service===
I'm still thinking about service-level methods. I'm not going to add the *All methods right now and I'm not going to have the single methods dive into the services (other than find, which even in jQuery digs into sub-elements not in your collection). The table I wrote below won't go into the docs.
Almost done with the docs for this. I wonder if I can have the jQuery UI widget method find merge results when more than one element are used in the selector. Unlikely but it would be cool. I'm going to have to assume not for now but keep that in mind.
===geo-service===
I am going to document that all service divs have the geo-service class. So, the default service will be both .osm and .geo-service.
===find===
It's quite clear to me that I should be able to call find on services. That will return shapes in that service. What does calling find on the map do? Should I have it search map and all services as planned or limit it to just map shapes? I have no idea what this would do in jQuery UI widget factory:
var shapes = $( "#map,#map .osm" ).geomap( "find", { type: "Point", coordinates: [ -71, 42 ] }, 4 );
What will be called, what's the return...just the first? Just the last?
For this version, I'm going to have find on the map only return shapes appended to the map. That will match how the other functions work and document that you cannot use the comma selector with the find method.
===proj===
I need to get the final doc changes in for the $.geo.proj auto-handling. The definition of "map coordinates" is determined by the last use of center or bbox. The "map coordinates" are used as return values for the center, bbox, and the bbox property of the view object passed to getUrl. Now, how to write that...
===replace===
Removing the rather extraneous label and style methods from my to do list and adding the much more useful replace method.
replace( existingShape, existingShape, style, label ) is the same as
append( existingShape, style, label ) but that's fine. If you want to remove existingShape and add a new one, you won't need two calls (remove & append).
===find===
I'm not going to add a shapes method either. I want that to be part of find. The next version of the find method should take various selector strings such as * and return an array of shapes. This also makes me want to revisit whether or not find can dig into services...I'll see what Peter thinks.
I feel like I want users to be able to write either:
$("#map .osm").geomap("find", "*") or
$("#map").geomap("find", ".osm *")
append, replace and empty are very one-item specific but find is a digging query operation. I think I just convinced myself that it should be different. It should dig into the services. That's what I think devs will expect. I already can't use find with more than one target...so I'm already breaking the convention of the other three methods.
I'm not going to support the service selector in find's selector argument at this point. But I documented how it will work with a service element selector and that seems pretty cool.
==2012-01-01==
===offline===
Responded to an email asking about offline support. I wrote a few things in my reply that should give him some ideas. I'll copy them here:
I have thought of offline support. While something like that likely won't be directly part of jQuery Geo itself, there are different ways to approach it depending on needs. I have plans to put up some demos to give developers ideas but here's a short list:
1. Using the getUrl function to cache downloaded tiles in session storage on IndexDB. Since this function in the service object can do anything you want, it's perfectly fine to check some HTML5 storage options for tiles and returning, e.g., a data URI before attempting to access the Internet. Users will get roaming charges only when the images aren't in the cache. However, the amount of images you can store in the cache is limited by what the browser sets for the cache's upper limit. Some mobile browsers allow users to increase this limit, others don't. This is an option better suited for sites that want to show large areas with many zoom levels.
2. Pre-caching the whole tile set in HTML5's appcache. This is suited for a site that only serves a small area and not too many zoom levels. You would have to get a copy of all the tiles and list them in a cache manifest file. If the user zooms or pans outside the site's area, they can get some "no tile" image. The huge advantage is that users can first browse to the site on WiFi, the app will cache the entire map (which will take a while) but can then walk around and map tiles will instantly come from the local cache. The disadvantage is that HTML5 appcache is usually only 5MB which won't hold too many tiles.
===remove===
I'm still trying to decide about whether or not remove should remove all references in all services or whether I need removeAll. There is precedent for xAll methods in jQuery. I will also need empty. This is too much for a4. Maybe beta or beyond.
method | map or service | function
==========================================================================
append( shape ) | map | appends shapes
| | only to the map
append( shape ) | service | appends shapes
| | only to the specific service
find( Point, radius ) | map | finds shapes appended
| | only to the map
find( Point, radius ) | service | finds shapes appended
| | only to the specific service
findAll( Point, radius ) | map | finds shapes appended
| | to the map or any service,
| | will not return duplicates
remove( shape ) | map | removes shapes appended
| | only to the map
remove( shape ) | service | removes shapes appended
| | only to the specific service
removeAll( shape ) | map | removes shapes appended
| | to the map or any service,
| | will remove all duplicates
==2011-12-22==
===buffer===
I'm going to implement buffer as an internal geo method for now & document it later. It's needed.
==2011-12-21==
===two finger===
So, Google has settled on two finger single tap for zoom out. Fine.
==2011-12-09==
===measure===
Previous measure shows up if you destroy & create map after originally double clicking to end a measure.
In destroy, _drawCoords and _drawPixels are both empty. Where's the data come from?
When back into the new control, _drawPixels has values. There isn't a _drawCoords. Ah, widget factory was using old data, I have to make sure everything is cleared during create, including these two arrays.
===measure-pan===
Problem when you pan the first time while drawing in axisLayout image.
It's not just axisLayout image. It's also not measure, it's drawPolygon as well. Ok, this is new ;) I works fine in a3. Maybe something with the implementation of axisLayout.
Doh! Another "don't set arrays equal to each other" issue. Does this happen to other devs?
==2011-12-08==
===semver===
All that chatter about what version naming to use and then the jQuery blog points to this: http://semver.org/
Also, here's the deal about the new plugins site: http://blog.jquery.com/2011/12/08/what-is-happening-to-the-jquery-plugins-site/
==2011-12-05==
===measure area===
I have to work on the measure area tool. Something's not quite right...oh yeah, I haven't implemented it yet.
===length===
measureDistance should be measureLength. The measureLabels object should have a length property.
==2011-12-01==
===getUrl===
I was going to bring our urlFormat property over from the old code but now I think I want it to be the same property on the service object. I think getUrl can be a function, but can *also* be a string for shorthand. This will obviously be a jsrender template string.
==2011-11-30==
===twheat===
I'm going to keep the twitter-heat demo and also leave twheat as its own app.
===service-level===
Finally writing some service-level shape docs for 1.0a4.
===wheel===
I would like to add a wheel option. We have a wheelMode property on the internal control that can be a few different things. I would like this to be simpler. Maybe just "wheel" and have it be "on" or "off". Or a boolean? But a boolean would limit future additions.
==2011-11-23==
===measure===
I'm going to port measure over as pretty much how it's done in our original project, in that it will have its own dedicated label.
===measure-label===
Trying to make the measure label look nicer than before. I'm adding a style to the document head just for the measure tool. I'm prepending it so designers can override any of the properties.
===jsrender===
Pulling in jsrender for the measure label. I'm going to have to do it anyway for shapeLabel, may as well do it now. Works well for my needs, I'm going to document the measureLabels option.
==2011-11-22==
===jQuery 1.7.1===
I'm still using 1.6.4 and will likely release that way. I'll have to test with 1.7. The notes say that .1 fixed a bug in mousewheel event. I didn't even know they had a mousewheel event. Maybe I can stop using the wheel plugin I've been using.
===label-container===
Judging from the layout below, I'm going to change textContainer to .geo-label-container and have it move around exactly like the shapesContainer. More like serviceContainer because it doesn't need to be the size of the frame.
#map .geo-map
.geo-event-target.geo-content-frame
.geo-services-container
.geo-service*
.geo-shapes-container
canvas
.geo-labels-container
.geo-label*
.geo-draw-container
canvas
.geo-measure-container
.geo-measure-label.geo-label
===refresh polygon===
I'm still curious why I don't use toPixel on Polygon shapes as a whole? Why the loops? Right, I was thinking toGeodetic. geomap's toPixel function only takes up to two dimensional arrays. Updated both functions.
===pan===
I need to pan both shapes and labels at the same time. I think I need a new container for these because drawing might be part of this as well.
===length & area===
Documenting and coding these because I'll need them for the measure tools.
===LineString middle===
There must be something in JTS that's similar to Esri's ILine.QueryPoint function but I can't find it. This is for getting the point along the line for the label. I want to add a generic function to $.geo. Ah, LineSegment.pointAlong.
Documenting pointAlong. Also implementing it! Works pretty well.
===line rotate===
I would like to rotate the line label based on the current segment but that will have to wait.
===geographics===
I'm going to merge labeling into geographics so that I can move the tech as a whole to indivdual services. That'll come later when I need to do service-level shapes.
==2011-11-21==
===measure===
I started porting measureDistance today but merged the branch in after being able to draw a line. The rest of it depends on being able to draw labels. Our internal library has _labelShape specifically for measuring but I'm going to merge that into the labeling engine for this release.
===append===
I need to update the append docs to include label before I do anything. Done. Since it's needed right away, I'm going to start porting labels over.
===shapesContainer===
Can I re-use $shapesContainer for labels? I'd rather not keep track of a second div. However, I think $shapesContainer *is* a canvas element so that's not going to work. Yeah, it's a geographics widget which...no, geographics appends the canvas. I can re-use that element...but semantically, it isn't correct.
That won't work anyway, I need these to exist at the service div level so they can be targeted by CSS.
However, labels not associated with a service would not be in a service div and would need their own div.
===layout===
Currently, the layout is, e.g.:
#map .geo-map
.geo-event-target
.geo-services-container
.geo-service
.geo-shapes-container
canvas
.geo-draw-container
canvas
($textContainer)
==2011-11-15==
===twheat===
I'm going to make this a real app with its own subdomain. I would like to use paging because the first page doesn't have enough results with a geo argument. What happens when there's no further pages. Is there a "next_page" property? Is is null?
The page will be more impressive if I try to geocode the location property to get more results.
Heh, this will blast a lot of queries at MapQuest. I'm going to have to store ids i've already processed.
That's soo much nicer!
Maybe I can get a couple old pages worth as well on the first search.
Twheat exists!
==2011-11-14==
===a4===
Time to start a4 docs. Hopefully this will be the last alpha.
==2011-11-10==
===merge===
I merged in the changes to support photos. It amounts to only a few hundred bytes minified and can be pretty useful. I couldn't find a good example service to use for the axisLayout demo.
==2011-11-09==
===axisLayout===
Peter likes axisLayout as well...sold!
===first===
Trying this out for the first time. I can get image tiles from an image server but the zoom is all wrong and it's not centered. wheel zoom is also pretty wrong.
===bbox===
bbox min values are negative. I suppose that makes sense because it's trying to put the top-left corner of the image in the center of the window. It should be tring to put the center of the image in the center of the window.
===mapbox===
MapBox uses an "official" tiling spec. In that spec the origin is in the bottom left. That doesn't mean the y-axis is flipped though but it does change how I calculate the tiling scheme. Maybe it does go up. That's awful, why would they do it different than web mercator?
Crisis averted, maybe? It looks like V2 of the MapBox API uses top-left origin and XYZ tiling: http://mapbox.com/hosting/api/
Maybe not averted? Calvin is saying that TileStream itself (as in not hosted by MapBox) only has one API. That doesn't sound right.
===getTiledZoom===
This is wrong for image types the way we want to understand pixelSize with images. A low zoom means a low pixelSize which is opposite of maps. I seem to have fixed that. I'm getting closer.
===refresh===
Refresh is ignoring tiles on the bottom & right edge of the viewport.
===top-left===
The image still starts out in the middle of the page but you can move it around and zoom.
===getUrl===
I forgot that while Peter's image server determines zoom levels backwards, I was going to handle that in the getUrl function of the service and have the pixelSizes of the tilingScheme be like normal. This works much better. Now I only have the top-left issue. That's not true, zooming bounces the new image to somewhere else, i.e., isn't smooth or correct.
===center====
So, I realized that at geomap zoom level 0, the image is way zoomed out and my center should be the center of the full image in pixels, so pixel width /2, etc. I changed that but my tiles are still misaligned.
Ha! I wasn't checking for undefined if you pass a zoom of 0. That means I wasn't setting the new center & pixelSize with updated values. All set. Now I'm only offset in the y location and I have a feeling that's because of the axisLayout.
===osm===
Somehow, the osm class i getting on the serviceContainer element even though I'm completely redoing the services array at init.
===centerMax===
I think for now I have to assume that at max zoom, the whole service fits in a tile and the center is in the center of the tile. I don't have a way yet to specify the center of a tiling scheme, only the top-left.
===pan===
Pan is backwards as well when it creates the new bbox.
Fixed pan.
===zoom===
Looking good! interactiveScale is last. Then maybe I should support shingled. Wait, no, that was interactivePan, when pulling in new tiles.
Zooming twice is a bug but that's in core jQuery Geo, not this image addition.
===shingled===
Here's a link to a sample shingled image: http://lib.byu.edu/mrsid/bin/image_jpeg.pl?client=sample&image=sample.sid&x=1024&y=2048&level=0&width=1024&height=480
Actually, there are levels so that's a tiled image. Yeah, definitely tiled because the level argument doesn't allow fractional numbers.
===ie select===
I think I forgot a userselect somewhere because if there are no inputs on the page and you pan, IE highlights everything in blue. Every map tile.
Adding any input or link to the page fixes this. Also, adding this to inside the map div seems to fix it too:
<input type="hidden" autofocus />
That fixed nothing. The issue isn't with panning, it's with shift-zoom and happens no matter what's on the page with IE9.
==2011-11-08==
===image coords===
I need a new property to determine the direction of the y-axis but I want it to be more generic. The difference is a different coordinate system, the side effect is the inverted ordinate axis.
Maybe just "coordinateSystem". I don't want to confuse users with the difference between coordinateSystem and tilingScheme though.
The full, proper term would be coordinateSystemAxisDirection or coordinateSystemAxisType. There seems to be a little precedence for CoordinateSystemAxis, found in GeoTools: http://docs.geotools.org/stable/javadocs/org/opengis/referencing/cs/CoordinateSystemAxis.html
Nothing in JTS.
Hmm, axisLayout? Why not, it's short and specific. axisLayout = "map" | "image". Yes. I like it.
==2011-11-07==
===gzip===
I added gzip to jquerygeo.com & all subdomains. jQuery Geo (minified & gzipped) is now 17k and falling!
===move===
I don't like that mouse move events seem laggy with this release. I need to find out what's different. I thought it was that I'm sending move events even while drawing that removing that hasn't helped.
===drawing===
Wow, geomap._refreshDrawing was terrible and geographics._drawLines needed a little tweaking.
===return false===
I didn't have any return falses at the end of my event handlers. I hope that plus the drawing fix makes panning better.
Oops, I went too crazy and added too many and wasn't letting the browser grab events it needed. Chrome's type=number input went crazy up or down if you didn't move the mouse away.
===chrome===
I've done what I can. The issue appears to be with Chrome or something I'm doing with Chrome. Drawing and panning speed is tremendous in IE9 and Firefox 7.
===geolocation===
Wow, after any timeout, Firefox stops checking for watchPosition? Is that part of the spec? Nope, not part of the spec. Oh, it *is* part of the spec if it fails due to timeout. It does sound like it's not supposed to trigger until the position changes despite what you put in maximumAge.
==2011-11-01==
===shapeStyle===
Time to redo the shapeStyle example in a much more awesome way.
Did I miss something? jQuery UI widget factory isn't complaining that shapeStyle isn't an option on the widget even though I haven't added it yet.
New demo is super-cool!
===refreshShapes===
I almost had this function clear the shapes geographics until I realized that it's recursive if there's a GeometryCollection. Can't do that.
==2011-11-01==
===refresh===
Cleaned up the wording for append, remove & empty. Also, going to have append allow style only, refresh only, or both.
===refreshShapes===
Due to performance, I'm going to disable the auto refresh after interactiveScale of shapes if the number of shapes is over a certain limit, say, 255.
==2011-10-31==
===tile paint===
Another app I want will be tilepaint.jquerygeo.com. It won't actually use jQuery Geo but will repaint tiles on the fly for you based in an input URL and color changes.
===fromGeodeticPos===
There's a bug trying to convert some positions of a town near Concord in the voting demo. I wonder what's different about that geometry.
The shape is a multipolygon which I am not handling properly. It can be a quadArray. I also removed all the $.each calls which should speed things up a bit.
All set now.
===ArcGIS Wrapper===
agw.jquerygeo.com will take an ArcGIS Server endpoint and spit out the jQueryGeo you need to initialize a map to that service. It should handle both cached and dynamic services.
==2011-10-30==
===voting===
I'm working with Calvin Metcalf at MassDOT attempting to push all the data into jQuery Geo. I might want an option to turn off scaling vector data because it's rather slow. Maybe only do it if they have WebGL.
Disabled it for now.
===refresh===
The refersh property must be made public, pushing large number of features isn't useful without out.
==2011-10-29==
===id/class===
I'm at WhereCamp Boston 2011 and going to try to finish Alpha 3 while I'm here starting with making id optional.
===initOptions===
Was getting undefined when a user passed nothing as in the simplest test.
===class===
So, I forgot that class is a reserved word. I'm not sure what to do about that. I can make id optional for now but I'll have to decide about class as a property name. I know as an object literal, I'm supposed to enclose the word in quotes but that's not going to look right for the user who wants to use this. I might have to call it cssClass or something. I'll find out what jQuery uses.
Google Closure won't even minify the build with the word class used as I'm using it. When I'm creating an element using jQuery's argument that takes an object for attributes, what do they use? They require quotes.
===id===
I'm still storing the service state by id. Since both id and class are optional, I think I need to store it as an array. That's not true, I can store an id on the service object via $.data. The id can be $.now. I wonder if $.now actually has different values if I'm creating more than on service at the same time? I will need to test and potentially use a different means to create the id.
===service create===
I'm going to assume that the service doesn't already exist during create. Not sure if that's a good idea though. Maybe for now, I won't and I can make the create code smaller later after I have time to test.
I completely forgot that I'm going to store the entire service state via $.data. That will make things a lot easier.
Seems to work ok.
===double click on unloaded===
When a singled image hasn't loaded after pan and you double click on empty space, the zoomed area seems wrong.
===fusion===
Andres from Google is showing radius query using fusion tables. Seems like something I can do with jQuery Geo.
===kml===
I might have to support kml.
===maps.jquerygeo.com===
I should support typing a url to a geojson file to append all of the json.
==2011-10-28==
===style===
Both shapeStyle and drawStyle get and set a plain JavaScript object and should be widget "option"s. While changing them does have side effects, they perform no action themsevles.
===centroid===
I'm leaving centroid in a3 but removing support for GeometryCollection for now (in the docs & code). That can come later.
===distance===
No sense having the two lines that support arrays, they'll never hit a valid switch case and it's not in the docs.
==2011-10-25==
===service state===
I finally moved it to a $.data store on the services container. It was getting messed up moving between pages in jQuery Mobile when one of the pages had a map.
==2011-10-21==
===resize===
Shingled maps don't resize properly. I think I have to have a resize method in there & call it from geomap. All set, I had to mark the current scaleContainer as not being for the given scale any longer and re-center it.
===visible===
I can't decide about this property of the service object. I need an API audit from Bocoup :(
Since I have opacity and visibility in shapeStyle, and I know I'm not going to change them, I think I do want to have the naming synergy because I do have opacity in service properties that I'm not going to change. Ugh, but the toggle method takes a true or false value. But so does jQuery's and that changes a CSS property from one text string to another.
===change service object===
Unlike the shape objects, I think it's fine if I change the service object's visibility property. It's sort of awful to see the check for undefined & I change it anyway when they use the toggle method. Why not just set it to "visible" when I create the service?
==2011-10-15==
===draw pan===
The current version didn't get the code ported over that disables inertia while drawing. I think I need to put that in because without it, the drawing does feel too fidgety.
I was calling _panEnd instead of _panFinalize for the draw modes.
===draw polygon===
Finally ported this code over. Seems ok.
==2011-10-14==
===maps===
I would like to make an app that lives at maps.jquerygeo.com and has some useful functionality similar to Google maps but uses all open data.
==2011-10-12==
===push it===
jQuery Geo is still functional in Chrome drawing all of the census tracts of MA. That's over 55,000 points and 3,000 features. Not too bad.
==2011-10-07==
===drawLineString===
I've ported some initial line code and actually made it much more elegant than our internal one.
===shingled===
The shingled demo needs some work.
==2011-10-06==
===bbox===
I pushed out a great new bbox example page. It links to a live jsFiddle even so people can play with the code.
===jQM buttons===
I did have to make the full screen map an external page. It worked ok after that and the back button still works.
===jQM===
jQM has virtual buttons to handle either touch or mouse input (some devices have both at the same time): vclick, vdown, vmove & vup. However, they don't handle multi-touch so I think I'm going to have to stick with what I have at the moment. I can't require jQM just to have jQG work on mobile.
===draw===
Porting our shape drawing code over finally. We're getting a new geographics widget to differentiate drawing from appended shapes.
===drawStyle===
I forgot to write about the drawStyle method. This one might actually be a true option as it will never be service-specific. It can only apply to the map widget.
===draw functions===
I need to rename some things. I've been using a few old names from our internal code but they don't quite make sense with some of the newer names of public properties. Mostly, shape should mean anything added via append and draw is the actual in-process drawing.
Two internal method names should be: _refreshShapes (instead of _drawGraphics) & _refreshDrawing (instead of _redrawShape)
===drawPoint dblclick===
As the docs say, a double tap will zoom in just like in pan mode and not trigger the shape event.
===geographics===
Oops, my underlying geographics widget is sharing the same canvas context. Flicker city! Ah, much better.
===drawPoint===
Because I'm delaying before I trigger the shape event, it feels slugish. Maybe I can drop the delay down to 100ms. Too fast, I'm getting the shape event.
==2011-10-04==
===jqcon===
I gave a presentation to jQuery Conference Boston 2011. I didn't have much time because I was sharing a block with another speaker. So, my presentation was rushed but I still think a few people interested. I will have to get better at conveying that this is not a wrapper for Google Maps or OpenLayers. We do not host any 3rd party controls.
===jQM buttons===
With a jQuery Mobile controlgroup or navbar on the same page as a full screen map, I get huge performance issues on Android. iOS seems ok with it. Desktop browsers are fine. The map doesn't pan while sliding your finger but it does show up in the new location when you let go.
Removing the navbar completely didn't help. I think that unless it's a small in-page map, I'm going to have to make the page external.
===bbox===
To test these new bbox functions, I'm going to redo the bbox example page.
==2011-09-30==
===json===
I can store a tiling scheme in JSON but just realized that I can't store a service definition in JSON because of the getUrl function property.
==2011-09-29==
===zoom===
Documenting and adding the zoom method.
===bbox===
Made bbox public. It's also now storing projected coordinates. $.geo.proj can also accept bbox arguments now.
==2011-09-28==
===disable auto-proj===
Peter suggested (for actual GIS users) a way to disable $.geo.proj but keep the object where it is. The situation is: "I know I'm working in a projection, and I want $.geo.proj to match that projection, but I don't want it to attempt to auto-project coordinates I pass to $.geo functions or geomap because I'm going to send it projected coordinates, but I do want the object around for when I might want to un-project some coordinates to geodetic."
That's wordy but it does make sense.
However, instead of adding a boolean on $.geo called autoproject and telling people that they can shut it off, I'm going to test diving into arguments to determine if they are geodetic and auto-projecting myself. There will be a performance hit but I need to test if it's too much or worth the simplicity. I think I'm going to find that it's worth the simplicity. I can then remove A LOT of words from the docs about if $.geo.proj is null, blah, blah.
That's fine for input values, but what about auto-unprojecting output values? Maybe I do need that boolean property on $.geo? Or I can store the last way center, bbox, or bboxMax were set and return values in the same format. I would rather it not be that tricky though. If I do add a property, it would only need to be for geomap. The $.geo functions are stateless.
===wkt===
Working on WKT.stringify/parse. There will be a $.geo.WKT object.
Moving along, made the frame of a nice test page too.
===destroy memory===
A destroyed geomap remembers what was in _graphicShapes. This means that any other private property initialized with _prop: default, is remembered. There could be other issues...until I replace all indivdual properties with a single state objects. For now, I'm going to reset _graphicShapes to [] in createWidget.
==2011-09-27==
===destroy===
Somethings wrong with destroy, can't create after. One thing missing is that resize is called (by jQuery Mobile?) after the call to destroy which causes a script error. I have to make sure I unbind resize. Huh, I've never had to unbind a handler before. Heh, destroy erases any content you had inside the widget before you created a geomap.
==2011-09-26==
===refactor===
Found bugs in serviceType.destroy and graphics due to code refactor. The CDN, while wonderful, takes too long to update. I suppose it's not the best idea to put the test branch on the CDN. Done. I'll still occasionally copy test to the CDN but mostly I'm going to update the non-CDN'd version until I know things are ok.
Alpha 3 docs online & tweeted about!
==2011-09-24==
===resize===
My code refactoring broke auto-resize. I wonder what else I broke :)
==2011-09-23==
===filename===
I renamed the compiled JS files to match what code.jquery.com has for jQuery itself and jQM. jQUI isn't on there, which is odd.
===widget factory syntax hack===
Testing if the syntax I want is possible with the jQuery UI widget factory pattern. I only want the one widget, but I want to be able to call some functions on other child elements. I already hit a snag. Calling .geomap("toggle") on an element that has not been initialized as a geomap widget doesn't trigger _createWidget, _create or toggle.
===serviceTyep files===
I'm going to split out the service type objects into their own files. That'll help me make sense of the geomap.js file.
To do that, I had to move _serviceTypes from being an option of geomap to a propery on $.geo itself. This will help third-party service type plugins down the road.
===widget vars===
I think I have to move all the widget vars back into the object passed to $.widget so that they don't conflict with each other, e.g., multiple geomap widgets. As they are now, I think they're all plugin-level widgets.
===sub-widgets===
This is awesome. It looks like I can get the syntax I want. Now to figure out the best way to call the method in the parent geomap widget from a service widget.
It seems like the vars created in the closure supplied to $.widget are still used by all widgets on the page. Do I really have to store state in a data object on the element?
Yes, they are shared. Yes, I will have to figure something out.
I just had to plaster my code with this's. I don't like it but it now supports the toggle/opacity syntax I want and *I think* also supports multiple maps on the same page (I think). That's going to increase my minified size quite a bit. I'm going to have to go back and see what I can do to clean it up but I'm choosing proper functionality over code size for the moment.
==2011-09-21==
===docs===
I'm trying to clean up the docs and change notational $.geo to jQuery Geo, but not mess up anywhere I mean to reference $.geo the namespace.
===class===
I have a better plan for service id. I'm going to keep my plan for having the presense of a name property create a hidden input but I'm going to allow the service object to have a class. The class will be applied directly to the built-in service divs. I will still apply data-service-type="tiled" or data-service-type="shingled" to the divs. To apply certain methods to specific services, you will now target the service class under the map element:
$("#map .osm").geomap("toggle", false); // this will hide OSM.
===service create===
I'm going to require that the service type's create function return a jQuery collection of one item that is addressable for that service. It doesn't really HAVE to have anything in it but I'm going to store service state on it using $.data($el, "geoServiceState", {}) or something.
===jqm===
Upgraded to jQuery Mobile b3 & added some color to the headers of various doc pages.
===service id===
After talking to Peter, I'm going to allow class and id with a note that if you use id, you'll have to be careful of adding more than one map on the page. I like this plan. Also, if you do it by id, you can target it directly:
$("#mass-gis").geomap("toggle");
===widget tricks===
I'm not sure I can do the selector tricks I want with the widget factory. I may have to change my docs & design if I can't do it elegantly :(
==2011-09-20==
===cache===
I may be caching too aggressively. I think I should remove caching from $.geo.bbox and instead cache inside of append and clear the bbox cache in remove. I really only need it in the find method.
===jquerygeo.com===
It's time this project got its own nice site. Also, (mt) is faster than my previous host from places farther away than MA.