2.0_beta sync to rsa
[framework/web/web-ui-fw.git] / libs / js / jquery-geo-1.0a4 / dev-journal-ryan.txt
1 == to do ==
2
3 === b1 ===
4 * examples - jQuery Mobile
5 * cdn - max age header should be infinite...always cache as long as possible, release code won't change
6 * docs - geomap - loadstart event
7 * geomap - loadstart event
8 * docs - geomap - loadend event
9 * geomap - loadend event
10 * docs - geomap - pass the service id (if there is one) to the src callback as a view property
11 * geomap - pass the service id (if there is one) to the src callback as a view property
12 * docs - geomap - support dynamic map services that only work in geodetic coordinates (sr=4326)
13 * geomap - support dynamic map services that only work in geodetic coordinates (sr=4326)
14 * docs - geomap - allow append to take an array of shapes
15 * geomap - allow append to take an array of shapes
16 * docs - geomap - allow remove to take an array of shapes
17 * geomap - allow remove to take an array of shapes
18 * geomap - cache label coordinates (the labelPixel cannot be cached, it will change each refresh)
19 * geomap - rotate label based on segment
20 * geomap - use pointer-events: none where appropriate
21 * geomap - test changing shingled service URL to get updated images (in case of dynamic data)
22 * geomap - replace data-geo attributes with classes
23 * docs - warn users about potential CSS/JavaScript issues relating to generated elements:
24 ** ul, li, div, span, img
25 * 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
26 ** a failed pan shouldn't add a point to drawCoords
27 * geomap - Firefox - [bug] inertial pan is choppy post touchstop
28 * geomap - iPad 2 - [bug] pointAlong doesn't take last point into account in all browsers
29 ** cannot reproduce; possibly axisLayout image only
30 * geomap - ie - [bug] ie highlights entire map div during shift-zoom
31 * geomap - [bug] iPad 2 panning is visually jumpy but settles on the correct bbox in the end
32 ** possibly only when axisLayout is image
33 * geomap - [bug] iPad 2 measureLength puts current length on second to last coord instead of last coord
34 * geomap - [bug] pinch zoom on iPad 2 (iOS 5) doesn't refresh tiles when zooming out
35 ** oddly, iPod Touch 4 (iOS 4) is fine
36 * geomap - [bug] first use of mouse/touch in any mode moves map by one pixel on mousedown/touch
37 ** possibly only when axisLayout is image
38 * geomap - [bug] multiples of the same event trigger after creating more than one map on the same div, even after destroy
39 ** destroy should unbind all geomap events
40 * geomap - remove this-style state properties
41 * geomap - remove "px" from .css calls
42 * geo - use Array.push instead of $.merge where needed
43 * geomap - [bug] changing services array (without changing all services) after initialization fails
44 * geomap - [bug] multiple maps do not work on the same page
45 * docs - geomap - add argument to refresh to force reload of images (in case of dynamic data)
46 * geomap - add argument to refresh to force reload of images (in case of dynamic data)
47 * geomap - create _defaultState object, use for widget-local _widgetState property, reinit _widgetState on _createWidget
48 * geomap - don't redraw shapes after interactiveScale, they've already been drawn at new scale
49 * geomap - [bug] exception when calling destroy on uninitialized div
50 * geomap - maybe throw an error when setting center to an invalid object, such as the first number in a coordinate array: coordinates[ 0 ] <== wrong!
51 * geomap - merge interactive pan and zoom into one, faster system (pan/zoom rewrite)
52 ** pan and zoom in same interactive session (_interactiveCenter & _interactivePixelSize)
53 ** delay image loading more during movement
54 * geomap - request new image in shingled service during interactive pan (after pan/zoom rewrite)
55 * docs - geomap - view.service.row & view.service.column to string multiple services together or repeat horizontal tiles
56 * geomap - view.service.row & view.service.column to string multiple services together or repeat horizontal tiles
57 * geomap - repeat horizontal tiles
58 * geomap - don't request tiles that > max possible y for scale
59 * geomap - do not interactiveScale non-tiled maps out past pixelSizeMax
60 * geomap - [bug] zoom in more than once with zoom method moves tiles to the wrong spot
61 ** postponed until after pan/zoom rewrite
62 * geomap - [bug] only services that have finished refreshing move when the user pans
63 ** check by zooming in then panning shingled demo with forest layer on
64 ** for a4: hide unfinished services; for b1: properly move the already zoomed service after pan/zoom rewrite
65 * geomap - [bug] map panning is jumpy, appears to be related to shapes and/or drawing context
66 ** postponed until after pan/zoom rewrite
67 * geomap - [bug] pan sometimes lags on first drag
68 ** cannot reproduce effectively, test again after pan/zoom rewrite
69 * geomap - use CSS transition or transform for smoother tiling
70 * geomap - implement service-level shape redrawing during interactive movement
71 * make a package for new jQuery plugin directory
72 ** https://github.com/jquery/plugins.jquery.com/blob/master/docs/package.md
73 * examples - drag shapes
74 * examples - ie7 - [bug] floating info div doesn't show up, inputs are alone and on the left
75 * examples - redo the jVectorMap demo page using jQuery Geo
76 ** http://jvectormap.owl-hollow.net/ ( found via http://www.moretechtips.net/2011/12/22-most-popular-jquery-plugins-of-2011.html )
77 * expose jQuery Geo as an AMD module so asynchronous loaders like RequireJS and curl.js can use it
78 * examples - geomap resize method
79 * examples - multiple maps example
80 * examples - Codecademy course
81 * geomap - [bug] when a singled image hasn't loaded after pan and you double click on empty space, the zoomed bbox seems wrong
82 * build releases using grunt
83 * remove BOM from release files
84 * add 3rd party license headers
85
86 === future ===
87
88 * docs - geomap - pan events (pattern after HTML5 drag)
89 * docs - geomap - zoom events (pattern after HTML5 drag)
90 * docs - geomap - support two-finger vertical slide as zoom on mobile devices
91 * geomap - pan events (pattern after HTML5 drag)
92 * geomap - zoom events (pattern after HTML5 drag)
93 * geomap - test jQuery widget call chaining when setting option values
94 * geomap - when scroll is zoom, attempt to not zoom while user is scrolling the page anyway
95 * geomap - allow src to return a callback function or Promise to delay image requests for some reason (multiple requests, etc.)
96 * docs - geomap - document the correct way to add a service after init
97 * geomap - remember last map unit type set with bbox and center, return all coords and arguments in that type
98 * geomap - unbind keydown handler on destroy, it's on the document
99 * docs - $.geo.WKT object
100 * geo - $.geo.WKT object
101 * geomap - panning cursor (for when user is actually panning)
102 * geomap - completely original cursor set for pan, zoom, draw, etc.
103 * docs - geomap - replace method
104 * geomap - replace method
105 * docs - geomap - allow service-level refresh
106 * geomap - allow service-level refresh
107 * geomap - reenable graphics redraw on interactiveScale, if canvas...and scale canvas
108 * docs & examples - settle on the word "option" in all text (instead of property) to match widget function
109 * docs - make all map examples live
110 * docs - explain the 96px scale bar, why 96?
111 * docs - write a full page about GeoJSON and what each object type is to $.geo
112 * docs - geomap - allow name as service object property
113 ** if a service has a name property, it will maintain a hidden input with the given name
114 * docs - geo - support up to GeometryCollection in distance
115 * geo - support up to GeometryCollection in distance
116 * docs - geo - support up to GeometryCollection in contains
117 * geo - support up to GeometryCollection in contains
118 * docs - geo - support up to GeometryCollection in centroid
119 * geo - support up to GeometryCollection in centroid
120 * geomap - stop using $.data to store bbox since it's only used for drawing; store on _graphicShapes instead
121 * geomap - show a drawPoint style while the mouse is down, hide if toolPan or dbltap scale
122 * geomap - android - [bug] cannot always pan map after appending shapes
123 * geomap - re-use services that have the same id as existing services
124 * geomap - deep extend existing service objects when services property is set
125 * geomap - cache point bbox if $.geo.proj is not null?
126 * geomap - spatially index shapes when a tilingScheme is in place
127 * geomap - internal - add _getVisibleTiles method and use it in tiled service and shapes spatial index
128 * geomap - remove wheel plugin and use built-in mousewheel event
129 * geomap - test how the comma selector works with the find method
130 * geomap - compile service src templates, refresh when services changes
131 * code - prefer $.data over $.fn.data
132 * 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
133 * docs - internal - document how geomap draws shapes, the geomapgraphics widget and the reason shapeStyle is a method
134 * docs - demo - location based notes/to do list
135 * geomap - label divs should have class="geo-label" & style="position: relative;"
136 * geomap - find should check labels first
137 * 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)"
138 * geo - Support WKT with $.geo.parseWKT & $.geo.textify
139 * geo - All bbox operations should be done in non-geodetic coordinates for accuracy
140 * geo - support bbox in distance ( fix geomap.find )
141 * docs - geomap - shapeLabel property
142 ** template for labels for all shapes added via append
143 * geomap - perf test putting all containers that need to move with panning in a single super-container
144 * docs - geomap - multiple labels
145 * geomap - multiple labels
146 * geomap - [bug] mouse wheel on bad or missing tile doesn't zoom out on first rotate
147 * docs/geomap - store WKT input for each service
148 * geographics - rename the generated style properties to something simple or get better control over closure compiler
149 * geomap - document and implement find's callback syntax
150 * geomap - repeat horizontal tiles
151 * geomap - custering demo/support
152 * proj - take scale factor into account when calculating distance in web mercator
153 * geographics - Disable fill by setting style.fill to "" & stroke by style.stroke to ""
154 * graphics - See Modernizr for comment on BB Storm & canvas detection
155 * geographics - document graphics widget
156 * geographics - support border, padding, and margin
157 * geographics - undo manual outer div style changes
158 * geomap - [BUG] Android browser stops pan/zoom after 7 logos on logo demo
159 * geomap - store a copy of shapes as WKT in a hidden input
160 * geomap - only update WKT copy if shape is appended with refresh argument set to true
161 * geomap - find - [maybe] after flatten, check more cached bboxes for non-Point geometrie
162 * docs - geomap - support TMS
163 * geomap - support TMS
164 * docs - geomap - toDataURL method
165 * geomap - toDataURL method
166 * docs - geomap - SVG & other neat elements/media in labels
167 * docs - geo - $.geo.guessLocation function
168 * geo - $.geo.guessLocation function
169 * docs - services - document the plugin architecture
170 ** create must return a jQuery collection where geomap can store state info
171 * docs - geomap - drawPush function
172 ** in the drawing modes, this function starts drawing or adds a point into the already-started shape at the given coordinate
173 ** immediately triggers the shape event if mode is drawPoint
174 * geomap - drawPush function
175 * docs - geomap - drawPop function
176 ** in the drawing modes, this function ends drawing or removes a point into the already-started shape at the given coordinate
177 * geomap - drawPop function
178 * docs - geomap - drawStop function
179 ** in the drawing modes, this function ends drawing and triggers the shape event with whatever coordinates have already been added to the shape
180 * geomap - drawStop
181 * geomap - use profiling to improve pan performance
182 * geo - potentially add address cracking
183
184 ==2012-02-15==
185 ===labels===
186 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.
187
188 ==2012-02-12==
189 ===find===
190 Need to implement the * selector. That was easy. $.isPlainObject thankfully returns false on strings.
191
192 ===unloaded image===
193 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.
194
195 ===shingled 0===
196 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.
197
198 ===service-level shape refresh===
199 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.
200
201 ==2012-02-11==
202 ===current services===
203 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.
204
205 === service style===
206 $.extend({
207     visibility: "visible",
208     opacity: 1
209   }, style)
210
211 That returns what you would expect if style is undfined.
212
213 ===str src===
214 I can't mod index in the template. I feel that there is a way, but it's not there yet.
215
216 ==2012-02-06==
217 ===mousewheel===
218 This needs to be updated, it doesn't work with jQuery 1.7.
219
220 ==2012-02-04==
221 ===options===
222 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.
223
224 ==2012-02-03==
225 ===proj===
226 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.
227
228 ==2012-02-02==
229 ===transition===
230 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.
231
232 ==2012-02-01==
233 ===destroy===
234 There's a bug with shingled services if I call destroy and try to re-create.
235
236 ===services===
237 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.
238
239 ===proj===
240 Finally, to get rid of proj. The point is, you should be able to use projected coordinates even when $.geo.proj is not null.
241
242 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!
243
244 ==2012-01-31==
245 ===shapes zoom===
246 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.
247
248 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.
249
250 ==2012-01-30==
251 ===geographics===
252 This widget needs some updates. For now, I'm just going to add the resize function.
253
254 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/
255
256 ==2012-01-28==
257 ===service-level shapes===
258 Where was I before I stopped to add Deferred & fix bugs? Right. The service-level geomap widgets should now initialize their own shapesContainer. 
259
260 ===resize===
261 resize is a method on the service object because shingled need to stretch the current image.
262
263 I need to finally add resize to geographics.
264
265 ===find===
266 find will have to query and include service level shapes.
267
268 ===map===
269 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.
270
271 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.
272
273 ===shapeStyle===
274 This should be fine for services.
275
276 ==2012-01-27==
277 ===Deferred===
278 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.
279
280 ===service shapes===
281 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.
282
283 ===init services===
284 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.
285
286 Not true, but it does unfortunately merge the first user supplied service with the default service, osm.
287
288 ===options===
289 I forget why I have _options and options. They are supposed to be internal vs exteternal but they are equal references.
290
291 ==2012-01-24==
292 ===a4===
293 What's next for a4? static mode.
294
295 ===static mode===
296 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.
297
298 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.
299
300 ===labels===
301 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.
302
303 Now that labelsContainer is part of shapesContainer, the next step is to put shapesContainer under a serviceContainer (which is inside servicesContainer). Got that?
304
305 ===service-level shapes===
306 Here we go! Each serviceContainer has a div that contains all the images. The geographics widget will be a sibling of that.
307
308 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.
309
310 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. 
311
312 ==2012-01-23==
313 ===addressing===
314 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.
315
316 ==2012-01-21==
317 ===pinch aftermath===
318 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.
319
320 ===drawPoint===
321 This acted funny with pinch zoom in that when the second finger hit late, a shape event got triggered at the first finger.
322
323 ===draw other===
324 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.
325
326 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.
327
328 ==2012-01-20==
329 ===pinch===
330 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.
331
332 If the second finger is late, we still only get the touchmove event which will work great.
333
334 ===android===
335 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.
336
337 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.
338
339 ===web workers===
340 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.
341
342 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.
343
344 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.
345
346 ==2012-01-17==
347 ===geomapshape===
348 May be getting multiple shape events when in drawPoint mode and attached via bind("geomapshape").
349
350 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.
351
352 ===wkt===
353 While not in this release, I have a need to fix WKT parsing. Finished parse LineString & (single ring) Polygons.
354
355 ===pinch===
356 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.
357
358 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.
359
360 This will tap into the _wheelLevel variable, which I should possibly rename later.
361
362 Dropping out of multitouch (lifting one finger) will end interactive zoom & call setCenterAndZoom.
363
364 We pick the largest ratio between x & y changes.
365
366 ==2012-01-16==
367 ===zoom===
368 Accidentally moved some code to where it didn't belong & broke interactive zoom. Fixed.
369
370 ==2012-01-12==
371 ===getUrl===
372 I would like to further have the service object's properties match html rather than css. I might rename this to just src.
373
374 ==2012-01-11==
375 ===scroll & drag===
376 I need options to disable the default behavior of scrolling and dragging.
377
378 ===html attr===
379 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.
380
381 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?
382
383 Only opacity.
384
385 ===scroll===
386 I would like to support two-finger vertical slide as zoom on mobile devices but I'm not ready to write that up yet.
387
388 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.
389
390 ==2012-01-2==
391 ===service===
392 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. 
393
394 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.
395
396 ===geo-service===
397 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.
398
399 ===find===
400 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:
401
402 var shapes = $( "#map,#map .osm" ).geomap( "find", { type: "Point", coordinates: [ -71, 42 ] }, 4 );
403
404 What will be called, what's the return...just the first? Just the last?
405
406 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.
407
408 ===proj===
409 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...
410
411 ===replace===
412 Removing the rather extraneous label and style methods from my to do list and adding the much more useful replace method.
413
414 replace( existingShape, existingShape, style, label ) is the same as
415 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).
416
417 ===find===
418 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.
419
420 I feel like I want users to be able to write either:
421
422 $("#map .osm").geomap("find", "*") or
423 $("#map").geomap("find", ".osm *")
424
425 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.
426
427 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.
428
429 ==2012-01-01==
430 ===offline===
431 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:
432
433 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:
434
435 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.
436
437 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.
438
439 ===remove===
440 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.
441
442 method                   | map or service | function
443 ==========================================================================
444 append( shape )          | map            | appends shapes 
445                          |                |   only to the map
446 append( shape )          | service        | appends shapes 
447                          |                |   only to the specific service
448 find( Point, radius )    | map            | finds shapes appended 
449                          |                |   only to the map
450 find( Point, radius )    | service        | finds shapes appended 
451                          |                |   only to the specific service
452 findAll( Point, radius ) | map            | finds shapes appended 
453                          |                |   to the map or any service,
454                          |                |   will not return duplicates
455 remove( shape )          | map            | removes shapes appended 
456                          |                |   only to the map
457 remove( shape )          | service        | removes shapes appended 
458                          |                |   only to the specific service
459 removeAll( shape )       | map            | removes shapes appended 
460                          |                |   to the map or any service,
461                          |                |   will remove all duplicates
462
463 ==2011-12-22==
464 ===buffer===
465 I'm going to implement buffer as an internal geo method for now & document it later. It's needed.
466
467 ==2011-12-21==
468 ===two finger===
469 So, Google has settled on two finger single tap for zoom out. Fine.
470
471 ==2011-12-09==
472 ===measure===
473 Previous measure shows up if you destroy & create map after originally double clicking to end a measure.
474
475 In destroy, _drawCoords and _drawPixels are both empty. Where's the data come from?
476
477 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.
478
479 ===measure-pan===
480 Problem when you pan the first time while drawing in axisLayout image.
481
482 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.
483
484 Doh! Another "don't set arrays equal to each other" issue. Does this happen to other devs?
485
486 ==2011-12-08==
487 ===semver===
488 All that chatter about what version naming to use and then the jQuery blog points to this: http://semver.org/
489
490 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/
491
492 ==2011-12-05==
493 ===measure area===
494 I have to work on the measure area tool. Something's not quite right...oh yeah, I haven't implemented it yet.
495
496 ===length===
497 measureDistance should be measureLength. The measureLabels object should have a length property.
498
499 ==2011-12-01==
500 ===getUrl===
501 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.
502
503 ==2011-11-30==
504 ===twheat===
505 I'm going to keep the twitter-heat demo and also leave twheat as its own app.
506
507 ===service-level===
508 Finally writing some service-level shape docs for 1.0a4.
509
510 ===wheel===
511 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.
512
513 ==2011-11-23==
514 ===measure===
515 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.
516
517 ===measure-label===
518 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.
519
520 ===jsrender===
521 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.
522
523 ==2011-11-22==
524 ===jQuery 1.7.1===
525 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.
526
527 ===label-container===
528 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.
529
530  #map .geo-map
531    .geo-event-target.geo-content-frame
532      .geo-services-container
533        .geo-service*
534      .geo-shapes-container
535        canvas
536      .geo-labels-container
537        .geo-label*
538      .geo-draw-container
539        canvas
540      .geo-measure-container
541        .geo-measure-label.geo-label
542
543 ===refresh polygon===
544 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.
545
546 ===pan===
547 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.
548
549 ===length & area===
550 Documenting and coding these because I'll need them for the measure tools.
551
552 ===LineString middle===
553 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.
554
555 Documenting pointAlong. Also implementing it! Works pretty well.
556
557 ===line rotate===
558 I would like to rotate the line label based on the current segment but that will have to wait.
559
560 ===geographics===
561 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.
562
563 ==2011-11-21==
564 ===measure===
565 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.
566
567 ===append===
568 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.
569
570 ===shapesContainer===
571 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.
572
573 That won't work anyway, I need these to exist at the service div level so they can be targeted by CSS.
574
575 However, labels not associated with a service would not be in a service div and would need their own div.
576
577 ===layout===
578 Currently, the layout is, e.g.:
579
580  #map .geo-map
581    .geo-event-target
582      .geo-services-container
583        .geo-service
584      .geo-shapes-container
585        canvas
586      .geo-draw-container
587        canvas
588      ($textContainer)
589
590 ==2011-11-15==
591 ===twheat===
592 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?
593
594 The page will be more impressive if I try to geocode the location property to get more results.
595
596 Heh, this will blast a lot of queries at MapQuest. I'm going to have to store ids i've already processed.
597
598 That's soo much nicer!
599
600 Maybe I can get a couple old pages worth as well on the first search.
601
602 Twheat exists!
603
604 ==2011-11-14==
605 ===a4===
606 Time to start a4 docs. Hopefully this will be the last alpha.
607
608 ==2011-11-10==
609 ===merge===
610 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.
611
612 ==2011-11-09==
613 ===axisLayout===
614 Peter likes axisLayout as well...sold!
615
616 ===first===
617 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.
618
619 ===bbox===
620 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. 
621
622 ===mapbox===
623 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?
624
625 Crisis averted, maybe? It looks like V2 of the MapBox API uses top-left origin and XYZ tiling: http://mapbox.com/hosting/api/
626
627 Maybe not averted? Calvin is saying that TileStream itself (as in not hosted by MapBox) only has one API. That doesn't sound right.
628
629 ===getTiledZoom===
630 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.
631
632 ===refresh===
633 Refresh is ignoring tiles on the bottom & right edge of the viewport.
634
635 ===top-left===
636 The image still starts out in the middle of the page but you can move it around and zoom. 
637
638 ===getUrl===
639 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.
640
641 ===center====
642 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.
643
644 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.
645
646 ===osm===
647 Somehow, the osm class i getting on the serviceContainer element even though I'm completely redoing the services array at init.
648
649 ===centerMax===
650 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.
651
652 ===pan===
653 Pan is backwards as well when it creates the new bbox.
654
655 Fixed pan.
656
657 ===zoom===
658 Looking good! interactiveScale is last. Then maybe I should support shingled. Wait, no, that was interactivePan, when pulling in new tiles.
659
660 Zooming twice is a bug but that's in core jQuery Geo, not this image addition.
661
662 ===shingled===
663 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
664
665 Actually, there are levels so that's a tiled image. Yeah, definitely tiled because the level argument doesn't allow fractional numbers.
666
667 ===ie select===
668 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.
669
670 Adding any input or link to the page fixes this. Also, adding this to inside the map div seems to fix it too: 
671
672  <input type="hidden" autofocus />
673
674 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.
675
676 ==2011-11-08==
677 ===image coords===
678 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.
679
680 Maybe just "coordinateSystem". I don't want to confuse users with the difference between coordinateSystem and tilingScheme though.
681
682 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
683
684 Nothing in JTS.
685
686 Hmm, axisLayout? Why not, it's short and specific. axisLayout = "map" | "image". Yes. I like it.
687
688 ==2011-11-07==
689 ===gzip===
690 I added gzip to jquerygeo.com & all subdomains. jQuery Geo (minified & gzipped) is now 17k and falling!
691
692 ===move===
693 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.
694
695 ===drawing===
696 Wow, geomap._refreshDrawing was terrible and geographics._drawLines needed a little tweaking.
697
698 ===return false===
699 I didn't have any return falses at the end of my event handlers. I hope that plus the drawing fix makes panning better.
700
701 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.
702
703 ===chrome===
704 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.
705
706 ===geolocation===
707 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.
708
709 ==2011-11-01==
710 ===shapeStyle===
711 Time to redo the shapeStyle example in a much more awesome way.
712
713 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.
714
715 New demo is super-cool!
716
717 ===refreshShapes===
718 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.
719
720 ==2011-11-01==
721 ===refresh===
722 Cleaned up the wording for append, remove & empty. Also, going to have append allow style only, refresh only, or both.
723
724 ===refreshShapes===
725 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.
726
727 ==2011-10-31==
728 ===tile paint===
729 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.
730
731 ===fromGeodeticPos===
732 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.
733
734 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.
735
736 All set now.
737
738 ===ArcGIS Wrapper===
739 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.
740
741 ==2011-10-30==
742 ===voting===
743 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.
744
745 Disabled it for now.
746
747 ===refresh===
748 The refersh property must be made public, pushing large number of features isn't useful without out.
749
750 ==2011-10-29==
751 ===id/class===
752 I'm at WhereCamp Boston 2011 and going to try to finish Alpha 3 while I'm here starting with making id optional.
753
754 ===initOptions===
755 Was getting undefined when a user passed nothing as in the simplest test.
756
757 ===class===
758 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.
759
760 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.
761
762 ===id===
763 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.
764
765 ===service create===
766 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.
767
768 I completely forgot that I'm going to store the entire service state via $.data. That will make things a lot easier.
769
770 Seems to work ok.
771
772 ===double click on unloaded===
773 When a singled image hasn't loaded after pan and you double click on empty space, the zoomed area seems wrong.
774
775 ===fusion===
776 Andres from Google is showing radius query using fusion tables. Seems like something I can do with jQuery Geo.
777
778 ===kml===
779 I might have to support kml.
780
781 ===maps.jquerygeo.com===
782 I should support typing a url to a geojson file to append all of the json.
783
784 ==2011-10-28==
785 ===style===
786 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.
787
788 ===centroid===
789 I'm leaving centroid in a3 but removing support for GeometryCollection for now (in the docs & code). That can come later.
790
791 ===distance===
792 No sense having the two lines that support arrays, they'll never hit a valid switch case and it's not in the docs.
793
794 ==2011-10-25==
795 ===service state===
796 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.
797
798 ==2011-10-21==
799 ===resize===
800 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.
801
802 ===visible===
803 I can't decide about this property of the service object. I need an API audit from Bocoup :(
804
805 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.
806
807 ===change service object===
808 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?
809
810 ==2011-10-15==
811 ===draw pan===
812 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.
813
814 I was calling _panEnd instead of _panFinalize for the draw modes.
815
816 ===draw polygon===
817 Finally ported this code over. Seems ok.
818
819 ==2011-10-14==
820 ===maps===
821 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.
822
823 ==2011-10-12==
824 ===push it===
825 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.
826
827 ==2011-10-07==
828 ===drawLineString===
829 I've ported some initial line code and actually made it much more elegant than our internal one.
830
831 ===shingled===
832 The shingled demo needs some work.
833
834 ==2011-10-06==
835 ===bbox===
836 I pushed out a great new bbox example page. It links to a live jsFiddle even so people can play with the code.
837
838 ===jQM buttons===
839 I did have to make the full screen map an external page. It worked ok after that and the back button still works.
840
841 ===jQM===
842 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.
843
844 ===draw===
845 Porting our shape drawing code over finally. We're getting a new geographics widget to differentiate drawing from appended shapes.
846
847 ===drawStyle===
848 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.
849
850 ===draw functions===
851 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.
852
853 Two internal method names should be: _refreshShapes (instead of _drawGraphics) & _refreshDrawing (instead of _redrawShape)
854
855 ===drawPoint dblclick===
856 As the docs say, a double tap will zoom in just like in pan mode and not trigger the shape event.
857
858 ===geographics===
859 Oops, my underlying geographics widget is sharing the same canvas context. Flicker city! Ah, much better.
860
861 ===drawPoint===
862 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.
863
864 ==2011-10-04==
865 ===jqcon===
866 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.
867
868 ===jQM buttons===
869 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.
870
871 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.
872
873 ===bbox===
874 To test these new bbox functions, I'm going to redo the bbox example page.
875
876 ==2011-09-30==
877 ===json===
878 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.
879
880 ==2011-09-29==
881 ===zoom===
882 Documenting and adding the zoom method.
883
884 ===bbox===
885 Made bbox public. It's also now storing projected coordinates. $.geo.proj can also accept bbox arguments now.
886
887 ==2011-09-28==
888 ===disable auto-proj===
889 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."
890
891 That's wordy but it does make sense.
892
893 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.
894
895 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.
896
897 ===wkt===
898 Working on WKT.stringify/parse. There will be a $.geo.WKT object.
899
900 Moving along, made the frame of a nice test page too.
901
902 ===destroy memory===
903 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.
904
905 ==2011-09-27==
906 ===destroy===
907 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.
908
909 ==2011-09-26==
910 ===refactor===
911 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.
912
913 Alpha 3 docs online & tweeted about!
914
915 ==2011-09-24==
916 ===resize===
917 My code refactoring broke auto-resize. I wonder what else I broke :)
918
919 ==2011-09-23==
920 ===filename===
921 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.
922
923 ===widget factory syntax hack===
924 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.
925
926 ===serviceTyep files===
927 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.
928
929 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.
930
931 ===widget vars===
932 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.
933
934 ===sub-widgets===
935 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.
936
937 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?
938
939 Yes, they are shared. Yes, I will have to figure something out.
940
941 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.
942
943 ==2011-09-21==
944 ===docs===
945 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.
946
947 ===class===
948 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:
949
950 $("#map .osm").geomap("toggle", false); // this will hide OSM.
951
952 ===service create===
953 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.
954
955 ===jqm===
956 Upgraded to jQuery Mobile b3 & added some color to the headers of various doc pages.
957
958 ===service id===
959 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:
960
961 $("#mass-gis").geomap("toggle");
962
963 ===widget tricks===
964 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 :(
965
966 ==2011-09-20==
967 ===cache===
968 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.
969
970 ===jquerygeo.com===
971 It's time this project got its own nice site. Also, (mt) is faster than my previous host from places farther away than MA.
972
973 ==2011-09-18==
974 ===shape===
975 Working on the event docs.
976
977 ===name===
978 I was originally going to rename id in the service objects to name so I could use it as an input name on a hidden input. However, I'm now going to require id but allow name as an optional property. If present, it will create the hidden input. This is now a future task and will not be in alpha.
979
980 ===append===
981 While adding the refresh argument to append, I started thinking again how I want to implement service-level graphics. It would be very nice if I could have the map>service syntax to jQuery and call append, remove and empty on that. I think I defined the syntax a while ago...yeah, see "On shape functions" from 2011-06-02.
982
983 The issue I have is that a page can have two maps. The default service has id=OSM. So, if I allowed $("#map #OSM") syntax, it would cause the page to have two elements with the same id, #OSM. However, $("#map [data-geo-service='OSM']") is way to wordy. I'll have to discuss this with others later as this is not an alpha feature either.
984
985 ==2011-09-16==
986 ===foss4g===
987 FOSS4G is an inspiring conference. I gave my talk and people seemed interested. There was a question about Google. I answered that it's illegal to use them and Chris Schmidt mentioned on Twitter that it's not illegal, it's just hard. We're talking different things. jQuery Geo would use Google tiles directly, which is against license. We will never host a third party widget inside the jQuery Geo div as part of the core functionality. OpenLayers wraps the official Google widget to get around the license restriction (since it's the official Google widget, there's nothing wrong with it) & keeps it up to date (or slides it around) when the user interacts with the OL map. I might do something similar as a blog post when I open up the service types plugin system but until then, but it won't be part of jQuery Geo..."here's how to do it if you want", type of thing. The developer would have to pull in the Google maps API themselves.
988
989 ===centroid===
990 I'll have to see if JTS uses Point or Coordinate as a return value & match it.
991
992 Centroid needs to use $.geo.proj for accuracy. The centroid should be calculated in web mercator & projected back to geodetic.
993
994 ===proj===
995 The way we do projection is different than how GIS does it. Usually, when you define a projection, you work in non-geodetic coordinates because the coords have been projected to a flat plane. With jQuery Geo, you work in projected coordinates (I call them non-geodetic) when you set $.geo.proj to null. This can be a little confusing but I think it works.
996
997 The first thing we would have to do internally is set $.geo.proj to null because we use pro
998
999 ===bbox proj===
1000 bbox might be an issue. a bbox in geodetic coordinates (lon/lat) that is a rectangle, will not be a rectangle in web mercator. That's not a problem with setting the bbox property on geomap but could prove interesting for the bbox of geometry objects. For example, the bbox of a square polygon will not be a parallelagram in geodetic coordinates.
1001
1002 SUGGESTION: Calculate & cache bbox in projected coordinates
1003 SUGGESTION: Document that lon/lat bboxes will not appear to be correct?
1004
1005 ===bbox cache===
1006 Peter and I got into a talk about caching bboxes. He's worried that we will have too many floating references to objects that cannot be collected. That is a valid point. For example: a user creates a polygon as an object literal, they then call $.geo.bbox on it, then the function ends. We will have a cache of the bbox, but most importantly the cache will reference the original polygon so the browser cannot remove it from memory. I agree that this isn't a great situation. However, the performance benefit gained by the find method is hard to ignore. Also, this only becomes a problem when the developer calls bbox directly. Even though we call it during the find method (building up cache), they are all removed when the dev removes shapes from the map with the remove method. I also know I need to research more about how $.data works with objects. I may be wrong about the reference/memory leaks.
1007
1008 ===point bbox cache===
1009 Now that I know I should cache bbox as non-geodetic, I think I should revisit my jsperf regarding caching a point. Since there's going to be much more calculation involved in $.geo.bbox, I might want to cache points. However, I think I should only cache them if $.geo.proj is not null. When it's null, non-cached points will still be faster as per my original jsperf test.
1010
1011 ===events===
1012 The new shape event will need a new event type. Position event won't cover it but it's similar. I'm not 100% sure if I should merge them. The new event type will be a shape event.
1013
1014 ==2011-08-24==
1015 ===utah===
1016 While zooming in, Chrome skips zoom level 12. I wonder if that's a bug in the control. It is. It's a rounding error in _getTiledZoom. Using floor and * instead...fixed.
1017
1018 ==2011-08-19==
1019 ===contains===
1020 Contains is spatial ref agnostic and is called by distance.
1021
1022 == 2011-08-07 ==
1023 === bbox ===
1024 I think I'm missing something from my bbox description.
1025
1026 === append ===
1027 I would like to say that devs can call append again on a shape and it will replace the existing one and clear the bbox cache. That might be a good compromise for bbox cache clearing because I don't want a method specifically for that. Maybe, I'm not sold on the word append replacing something that's already there. Does jQuery have a replace function?
1028
1029 SUGGESTION: geomap - append should allow re-append of existing shapes, replacing the old one and clearing the bbox cache
1030
1031 === bbox ex ===
1032 I'm writing an odd example and I already forget if fromGeodetic can take a single position. It can, according to my docs :)
1033
1034 === from/to pos ===
1035 I keep going back and forth about coordinate vs. position in terms of words. I almost thought of changing fromGeodeticPos to fromGeodeticCoord but they /are/ called positions in the spec so I'm going to leave it. Again, it's spoken words (of which I suppose I am now including API function names) and code, which is GeoJSON object properties and arguments. Still confusing, this will never be settled so I'm dropping it.
1036
1037 === bbox cache ===
1038 Oops, I wasn't namespacing my data. I thing it has to be geoBbox because the namespaced data attribute would be data-geo-bbox.
1039
1040 == 2011-08-06 ==
1041 === alpha 2.5 ===
1042 I released a new version last week and it seems to work well. I'm happy with it. On to documenting the features of alpha3!
1043
1044 === label ===
1045 I'm going to add labels and I think I want a label argument to append, however I want both style and label to be optional. In other words, you can pass a shape and a label. The label argument will be a string of html or a jQuery collection of elements to append to a label div. The outer label div is controlled by geomap. It will have a class on it, geo-label, if devs find they need or want to control it that way, i.e., add plain text and control the label style using the class.
1046
1047 === jQuery a plain ===
1048 Is a jQuery collection a plain object? Not according to this fiddle: http://jsfiddle.net/ryanttb/4rHK5/
1049
1050 So, I will have two optional args: style and label. Style has to be a plain object. Label can be a string or jQuery object. I'll say style comes first but they can be in any order.
1051
1052 === shape props ===
1053 Even though I have args on append, I will eventually allow both style and label properties on the GeoJSON object. They're not standard but not illegal according to the spec.
1054
1055 === stored label ===
1056 For speed, I will have to build the label HTML during the call to append, whether or not I use the shapeLabel property on the map or the label supplied during append.
1057
1058 === override ===
1059 The label supplied to append will completely override the map's shapeLabel property.
1060
1061 === centroid ===
1062 While I would like a LineString's centroid to be a point along the line so I can using it for labeling, that's not the accepted definition of a centroid of a line. According to JTS, it's calculated like a polygon, except when there is a polygon as part of a GeometryCollection. In which case lines and points are ignored when calculating centroid.
1063
1064 === line label ===
1065 Checking to see if JTS has an official point-along-line function that I can add w/o creating my own name. It doesn't seem to. I just decided to not label on the centroid for lines but on the "center point" of the line. As you add more points, the label will move further along the line.
1066
1067 === envelope & bbox ===
1068 So, OGC simple features doesn't seem to define an Envelope class. The Envelope function is defined to return a Polygon, eww!
1069
1070 === ogc text align ===
1071 They do define text alignment options called HorizontalAlignment: start, center and end. Might be useful later for text label options.
1072
1073 === $.geo & proj ===
1074 Internally, I need to call the geometry ops in $.geo and I will already have a projected bbox or geometry object. I need a way to tell methods such as $.geo.expandBy to not call $.geo.proj.fromGeodetic even if $.geo.proj is not null. I think for now I will have an internal (and undocumented save for here) argument at the end called ignoreProj. If truthy, it will not call fromGeodetic. A false value or undefined will call fromGeodetic if $.geo.proj is not null.
1075
1076 The documentation will always say fromGeodetic is called if $.geo.proj is not null.
1077
1078 SUGGESTION: Add an internal ignoreProj argument to $.geo geometry functions.
1079
1080 === scaleBy ===
1081 I haven't used it yet buy my original port of the scaleBy function was wrong. I was calling expandBy which would make scaleBy(bbox, 1) actually increase the size of the bbox, however, scaleBy(bbox, 1) shouldn't change the size at all. Also, expandBy was wrong basing itself on center instead of just modifying the min/max values directly.
1082
1083 === geodetic bbox ===
1084 I forgot that from/toGeodetic don't currently support bboxes. What am I doing already in geomap? Ah, right. I only needed it once (the bbox property) so I'm converting to two positions by hand. I think I should make a conveniance method in $.geo.proj. fromGeodeticBbox or something. I'm not going to make it public. Devs shouldn't have to call it, they can work in whichever projection/non-projected state they set $.geo up as and the public functions can handle it.
1085
1086 SUGGESTION: add private _from/_toGeodeticBbox methods
1087
1088 I did remove the, "if $.geo.proj is not null X first calls fromGeodetic..." shpeal that I had in all the bbox methods because it's not accurate. I won't call from/toGeodetic, I'll call a private method.
1089
1090 Actually, I should be able to detect a bbox vs any other geometry in the *Geodetic methods. It will be an array of 4 numbers, so .length == 4 and $.isArray(value[0]) == false. Maybe I'll put bbox conversion into them after all.
1091
1092 == 2011-07-30 ==
1093 === alpha 2.5 ===
1094 It's been too long since I had a chance to work on this and I want to get an alpha 2.5 release out.
1095
1096 I need to push this back in an change my current branch name. I think it's alpha3 at the moment.
1097
1098 === jsperf ===
1099 I wrote a perf for point & linestring bbox cache testing. The test makes me think jQuery.data doesn't do what I think it's doing. When I cache the bbox in a local var, it's very fast but when I cache with data, it's not.
1100
1101 * Here's the point test: http://jsperf.com/point-vs-bbox
1102 * Here's the line test: http://jsperf.com/line-vs-bbox
1103
1104 It's always faster to test points by themselves, i.e., don't worry about checking for a cached the bbox.
1105
1106 === branch ===
1107 I was on master, so I pushed, then created & switched to alpha2-5.
1108
1109 === opacity ===
1110 When developing the heat map example, I remember running into an issue where I couldn't get the opaicty to look right between the border and center. Maybe I fixed it somewhere else because I can't seem to reproduce that.
1111
1112 I can still get it on the latest fiddle of the heat map. It's when the opacity is 1 and the strokeOpacity is 0, the stroke still shows up but it should be hidden.
1113
1114 I still can't recreate this on the shapeStyle test page :( Ah, but the twitter heat example has the issue.
1115
1116 Turns out I was or'ing the stroke/fillOpacity with regular opacity in _getGraphicStyle. That's not the right place to do anything with them, and never or.
1117
1118 === service opacity ===
1119 I'm going to pull in the service opacity method from AppGeo.Web as "opacity" on each service object, like refresh.
1120
1121 That's done. I haven't documented/implemented what happens if you don't pass a service id. It's required. I'm not sure what I want that to do yet.
1122
1123 === visible ===
1124 When starting to think about geomap.toggle, I realize I have a naming conflict so to speak. The service object has a boolean visible property while the shape style has a string visibility property. I think I want to change the service to match the shape style. I don't think there are any attributes in HTML that pertains to visibility so I'm going to match CSS even in the service object which is more internal and less graphical. That said, I don't want to start renaming things in alpha 2.5 so that'll wait until 3.
1125
1126 SUGGESTION: Rename service.visible to visibility having either "visible" or "hidden" values
1127
1128 === service props ===
1129 So, I noticed that when a service is created, I don't modify the service objects to fill all the supported properties. So, when toggle is called, there's potentially not an initial visible property set.
1130
1131 I think for now, alpha 2.5, I will have the toggle function assume that there could be an undefined service.visible. The refresh method does the same. Later, though I think I might want to set defaults during _createServices.
1132
1133 === proj ===
1134 New projection code seems to work and is awesomely 150 lines shorter!
1135
1136 === resize ===
1137 I'm going to hook into the window resize event automatically but I will still need a resize method later in case the dev changes the div size/css.
1138
1139 SUGGESTION: Add a resize method to let geomap know the div has changed size programatically
1140
1141 I'm not sure of the correct way to kill & remake graphics now that it's a jQuery UI widget. It appears that I can call distroy & re-create it.
1142
1143 Resize, is working though when getting smaller, there is a space for the scroll bars. I don't remember having that issue with the internal AppGeo.Web control. That is an issue to tackle after alpha 2.5.
1144
1145 === dbl tap ===
1146 What is a thumb? On touch devices, and other soft-dblclick devices I don't take into account that the second click/tap might be too far from the first to count as a tap. There is no move event to cancel. I'm now calculating distance between the two based on _anchor (previous) and _current ( current :). This will need testing. I'm setting it at 10px for now, line 1480 of geomap.js as of this writing.
1147
1148 == 2011-07-19 ==
1149 === wkt ===
1150 Wrote up some to-WKT code for our internal control today. WKT will also be supported by parseWKT and textify methods in $.geo.
1151
1152 SUGGESTION: Support WKT with $.geo.parseWKT (like JSON.parse or $.parseJSON) and $.geo.textify (like JSON.stringify).
1153
1154 === centroid ===
1155 Wrote up some centroid code for all but GeometryCollection as well for our internal control. Code similar to this will end up in $.geo.centroid.
1156
1157 == 2011-07-15 ==
1158 === presentation ===
1159 My first real talk about $.geo went well, I think. Next up is FOSS4G in September and, possibly, jQuery Conference Boston in October & Harvard WWW in December.
1160
1161 === alpha 2.5 ===
1162 I think I want to push out a bug-fix release of the alpha 2 tech. I'll tag it as alpha 2.5 in github but overwrite the alpha2 js file on host. Well, rename the old one as alpha2.0 in case people find a bug in the new one.
1163
1164 I need to write down exactly what to do for alpha 2.5.
1165
1166 === shape images ===
1167 People really want images on shapes, particularly points. I'm removing this feature from my TO DO list:
1168 * geomap - Document and implement passing a function to shapeStyle and append that returns a geomap style object based on feature or geometry properties
1169 because I have a much better plan that involves the label div. It will be a normal div and have a class. Each will have relative position and designers can manipulate it however they want.
1170
1171 == 2011-07-12 ==
1172 === fiddles ===
1173 Some fiddles for my demo on Wednesday:
1174
1175 # show a map:
1176 #* http://jsfiddle.net/ryanttb/A6avG/
1177 # show a map & zoom to boston
1178 #* http://jsfiddle.net/ryanttb/2qBgw/
1179 # show a map & zoom to geolocation
1180 #* http://jsfiddle.net/ryanttb/Pre4k/
1181 # add a location search
1182 #* http://jsfiddle.net/ryanttb/3LpqG/
1183 # add a twitter search: rpp=100
1184 #* http://jsfiddle.net/ryanttb/79zTk/
1185 # use map center as geocode, radius=(pixelSize * width/2 ) / 1000
1186 #* http://jsfiddle.net/ryanttb/2PCUu/
1187 # change style to heat map (16x16 size 8 border-radius)
1188 #* http://jsfiddle.net/ryanttb/PUeRc/
1189 # update on bboxchange
1190 #* http://jsfiddle.net/ryanttb/8LQLW/
1191 # show tweets in popup
1192 #* http://jsfiddle.net/ryanttb/y2gTh/
1193
1194 == 2011-07-07 ==
1195 === bbox ===
1196 I added bbox caching! I even check to see if the GeoJSON object has a bbox property, which is legal. There's no way to update the bbox but that'll come later.
1197
1198 === distance ===
1199 I almost tried to have distance support taking in a Feature but that opens a whole can of worms. I'm going to fix find to only send base geometry types to distance.
1200
1201 DOCUMENT: geometry methods will only take base geometry types (Point, LineString, Polygon & Multi*) or coordinate arrays
1202
1203 I had some weird comment on this method, it should be documented to only take base types, as I just said.
1204
1205 === form input ===
1206 I was talking to Chris last night about what geomap does that others don't and he reminded my about the idea I had of keeping a hidden input of the shapes as WKT. This would mean that I had to have a property on geomap for the map's name and also definitely change the service object to use name instead of id for when I add service-level shapes. WKT becomes a problem though when they've added features. I suppose I would dig into the features and only pull the geometry.
1207
1208 === json ===
1209 It's been a while since alpha 2. I'm working on a demo that draws the US state boundaries as graphics.
1210
1211 == 2011-06-30 ==
1212 === min ===
1213 Srsly? I wasn't using minified jQuery in my examples? Wow.
1214
1215 == 2011-06-29 ==
1216 === alpha2 ===
1217 Released alpha 2. I don't think anyone's really using it yet though.
1218
1219 == 2011-06-28 ==
1220 === on services ===
1221 I think it would be nice to deep extend service objects that come in via the services property if a service with the given id already exists in _currentServices. This way, you could set the initial opacity of OSM by simply sending {services: [{id: "OSM", opacity: .8}]} during init.
1222
1223 SUGGESTION: deep extend existing service objects when services property is set
1224
1225 === on opacity ===
1226 I was beginning to try to throw the opacity & toggle methods into alpha2 but setting the services property is too flickery. I want to do it more like the old widget but that will require adding opacity and toggle methods into the services types. That will have to wait. It will be much faster to call the opacity/toggle methods on geomap than to set the services property each time. I will have to document that.
1227
1228 SUGGESTION: require opacity and toggle functions in the service type objects
1229
1230 == 2011-06-27 ==
1231 === on events ===
1232 I almost forgot that I don't want bboxchange to fire when the developer changes a property in code. Unlike jQuery UI, my events trigger only when the user does something.
1233
1234 === on alpha 2 ===
1235 I'm trying to put this together.
1236
1237 == 2011-06-24 ==
1238
1239 === on shape methods ===
1240 I'm almost done. I need to finish empty and then I have what I wanted for an alpha 2 release!
1241
1242 === on Point vs. coordinate ===
1243 I think I'm going to settle on using Point objects everywhere except the projection functions. Which means I need to change find to accept a Point instead of an array. This should work out because the position events already send GeoJSON objects instead of position arrays.
1244
1245 === on geometry ===
1246 contains doesn't care about projections. Lon/lat values do not need to be projected.
1247
1248 I got done some of the geometry functions in $.geo but I'm leaving them private for now until I have a chance to document them and fully implement them.
1249
1250 === on proj ===
1251 Finished changing the $.geo.proj docs to explain that it will convert any GeoJSON coordinates array. I think I will also change the requirements to implement other projections by having the developer only have to override single position conversion functions (instead of worrying about the dimentionality of the passed array). Done.
1252
1253 === on find ===
1254 Now that proj is more powerful, I think I can handle find.
1255
1256 == 2011-06-18 ==
1257 Accidentally coded append differently than how I documented. Will fix the code. Documentation FTW!
1258
1259 I can't decide if the geometry functions in $.geo should only accept the base geometry types or not. Initially they will not. I don't want to even think about getting into $.geo.distance(multiPoint, geometryCollection).
1260
1261 $.proj should go up to a three dimensional array to handle the coordinates in a Polygon. Go big or go home, I'm going to support four dimensional arrays so that I can get MultiPolygons as well. That will handle all of the GeoJSON types that have the coordinates property. If you have a GeometryCollection (geometries property), a Feature (geometry property) or a FeatureCollection (features property), then you're on your own.
1262
1263 I may change every mention of "web mercator" to "spherical mercator" to be more specific.
1264
1265 == 2011-06-17 ==
1266 Attempting to change drawPoint from ovals to rounded rectangles. Shortcutting to drawArc if the width/height/borderRadius are the same.
1267
1268 Since I plan to make geographics public at some point, I thought I might make the drawPoint/Line/Polygon functions take actual GeoJSON shapes but I think that might conflict with some functionality internal to the geomap during digitization...I'll have to revisit this.
1269
1270 I seriously need to settle on the word "position" in my code when referring to an array containing an x/y. I use coordinate a bunch because that's what I used in the old project. Oh, but the property name of the GeoJSON object is coordinates. Heh, this is so confusing :) Ok, as I have been doing: coordinates in code, position in documentation.
1271
1272 I'm using cowboy's safeParse but can't tell what it's guarding against. I thought it would always give me a number but that's not the case. Guard against NaN or undefined?
1273
1274 Should drawing a bbox ignore borderRadius? I haven't decided.
1275
1276 You can fill and then stroke the same path, just sayin'.
1277
1278 Point graphics now draw as rounded rectangles. There's weirdness if your sizes are a little off though. I should probably start clamping values to each other like width & height to borderRadius. Yeah, if either is smaller than borderRadius the drawing gets weird. Maybe I should clamp borderRadius instead. Probably. Yeah, have to clamp borderRadius to min(width, height)/2.
1279
1280 I don't think you can disable fill by setting style.fill to "", but you should be allowed. It shouldn't be required to set fillOpacity to 0.
1281
1282 I just dropped a couple loops out of my graphic drawing in geographics. Should help a bit :)
1283
1284 == 2011-06-12 ==
1285 I'm finally pushing the renaming changes to the main project.
1286
1287 === On examples ===
1288 I talked to Boaz at Bocoup the other day. He suggested cleaning up the examples. I already had this in mind but I should probably do it sooner rather than later. Especially the simplest example. It will look nicer if I cut the div down to 256x256 to match the initial tile I think (done, it already feels better). I do need to keep the examples specific and don't want to add any HTML or JavaScript to them that does not directly relate to the feature I'm testing in the example.
1289
1290 He also suggested unit tests and an API audit, both of which are great ideas and much needed by $.geo.
1291
1292 === On ovals ===
1293 Peter and I discussed how points are drawn and what width and height mean in geomap styles. We both agree that ovals are not very useful or used constructs in GIS and it would be better to have rounded rectangles. Therefore, I am dropping ovals and intead supporting a borderRadius property. Circles are still possible as long as your width, height and border radius are all the same, you will have a circle. This will be the default.
1294
1295 === On double-click zoom ===
1296 Peter and I both agree that double-click zoom should operate similar to mouse-wheel zoom in that the bbox should scale according to the placement of the mouse cursor during double-click instead of completely re-centering. You will notice that mouse-wheel feels right and double-click can be confusing.
1297
1298 SUGGESTION: Double-click zoom should scale according to cursor location instead of re-centering
1299
1300 === On position events ===
1301 I cannot decide if I should officially make the geo argument passed to the position events (move, click, dblclick) a true GeoJSON Point object. The only difference would be the presense of a type property set to "Point". However, the extra pixels property that I have on the geo argument is not part of GeoJSON and will remain in memory. Also, if a developer pushes the new object to a database they are storing extra information that they don't need and will be useless later.
1302
1303 Is the pixels property even that useful? The dev can call geomap.toPixels if they need it. I added the pixels property just because I had the pixels lying around in the internal handling of the event. I think I might just not pass them. It would be more useful to a developer I think to have a true GeoJSON Point object that they can send to geomap.append or a database without worrying about having extra useless data stored with it.
1304
1305 SUGGESTION: Remove the pixels property from position events and add the type property to make the event argument a true GeoJSON Point
1306
1307 I just updated the docs and changed the implementation. I already like this a lot better and am now thinking that the bbox event type could actually send a true GeoJSON Polygon with the bbox property set. That would be totally within the GeoJSON spec and might be useful. That's a bit of extra code on the widget's side though so for now I'm going to leave it as is. I can add that feature later since the current implementation (an object with just a bbox property) is already partially in a true Polygon's spec.
1308
1309 FUTURE SUGGESTION: Send a true GeoJSON Polygon object as the geo argument of bbox events
1310
1311 === On returning jQuery collections ===
1312 I need to better design the return values of the shape methods other than find & shapeStyle. Should append, remove and emtpy return the jQuery object of the map elements that the call originated from? Probably.
1313
1314 I just tested and yes, as long as you don't issue a return statement inside a jQuery UI widget method, jQuery UI will return the original jQuery collection for you.
1315
1316 == 2011-06-10 ==
1317
1318 === On geographics ===
1319 I am going to leave drawArc in the graphics widget. The drawPoint method will draw our default point shape (rounded rectangle) but, in the future, when custom drawing is in, a developer can use the drawArc if they want.
1320
1321 === On proj ===
1322 Peter has updated web mercator <=> geodetic code for me to drop into $.geo.proj.
1323
1324 == 2011-06-06 ==
1325
1326 === On renaming shape functions ===
1327 Renamed the shape functions. That was annoying but I'm glad I only had addShape implemented.
1328
1329 === On jQuery UI widgets ===
1330 The widget factory does hide methods that start _ from being called. So much for renaming drawArc to _drawArc and still calling it from geomap.
1331
1332 DEPRECATED SUGGESTION: Turn geographics into a NON-jQuery UI plugin
1333
1334 Did I totally get the scoping wrong for the jQuery UI widget? I have local vars in my initial plugin closure. Will they conflict if there are more than one map?
1335
1336 SUGGESTION: Verify that vars local to initial closure do not conflict when multiple maps are placed
1337
1338 == 2011-06-04 ==
1339
1340 === drawArc ===
1341 I just realized that by dropping geographics.drawArc in favor of drawPoint I am losing the ability to draw the circles I need for digitization modes. I wonder if, before I turn DrawPoint into a box-like function, that I should copy it to _drawArc. Will jQueryUI.widget let me call it from geomap?
1342
1343 === shapes ===
1344 Chris and I were talking about merging append (previously addshape) and find into one call: shapes. If you pass a GeoJSON object or array of, it will add them. Otherwise, it will find them. Thinking about this today, I don't quite think that's the way to go. I mostly feel that calling geomap functions to manipulate shapes is closer to adding elements to a jQuery collection. In other words, to call the geomap functions you must have already wrapped an element with jQuery, $("#map").geomap("funcName"). When you wrap elements with jQuery normally, you have to call append, find, etc. Geomap will work the same with. Of course, I do still want the syntactic sugar later: $("#map").append(geoJsonObj);
1345
1346 == 2011-06-02 ==
1347 Who needs a blog. I feel like the best place to keep a developer journal is in the project itself so here we go.
1348
1349 === On addShape's style argument ===
1350 I showed Peter the shapeStyle demo. He expected that the shape-specific style applied via addShape would only override properties set during addShape. Further manipulation of the base shapeStyle would cascade to the shapes for any properties not explictily set. You know, like CSS. This is obviously the correct way to go and I already forget what made me code it the other way last night. Likely that I was coding at 2am and thought that if a user was passing a style to addShape they would want ALL style properties set in stone for that shape. That is not the right idea. If they want all properties set in stone, they can override all properties in the style object sent to addShape.
1351
1352 I changed the implementation before leaving work.
1353
1354 === On storing & modifying style ===
1355 My initial implementation drawing shapes in $.geo is very similar to how I did it with our internal control. I also showed Chris the shapeStyle demo and explained how you can add a style that's different from the base style on the map. He suggested that there be a way to change the style of an already added shape. I figured that I could make addShape update existing geometries instead of adding a new one but the syntax felt wrong. An updateShape method would work and could pass right through to addShape internally.
1356
1357 He also suggested allowing access to the internal GeoJSON->style map (as a return value for addShape) so they can maybe change the existing styles that way. However, something doesn't feel correctly designed about that.
1358
1359 We discussed attaching the style to the GeoJSON object. I already had supporting that in mind. If the user happens to have put a style property on the GeoJSON object before passing it to addShape, I would use that when drawing. A style passed to addShape would override that. The cascade would be: base style => GeoJSON object style => addShape style. A developer can keep the style property on the object even when it's stored, such as in GeoCouch, something that Guido wants a lot.
1360
1361 That said, I know I'm going about this wrong. As I said, my initial implementation feels too much like the old one and I want to do something much slicker in the jQuery world. On my walk home, I realized that since I am only storing a reference to the GeoJSON object and the user supplied style I can probably connect the style object to the GeoJSON object using jQuery's data method.
1362
1363 I wasn't sure if targeting a plain object is allowed in jQuery. I know it's possible but that doesn't mean I should. I remember IRC talk about it but forget the outcome. Info on ticket 8108 (http://bugs.jquery.com/ticket/8108) reveals that the DataLink plugin does this so I'm going to assume it's ok.
1364
1365 This little fiddle shows that the data properties don't show up with stringify http://jsfiddle.net/ryanttb/PetpJ/ but I'm going to do more research to see if it changes the object in a way devs will notice.
1366
1367 The data method doesn't natively support namespacing. I could do it myself using a period but I would like to follow what jQuery Mobile is doing with their data attribute stuff. They use data-jm-role which I believe equates to the call .data("jmRole") but I need to check up on that as well. So if I were to do data-geo-style, that would be .data("geoStyle"). I can live with that.
1368
1369 SUGGESTION: Store $.geo styles via $(geoJsonObj).data("geoStyle", style)
1370
1371 === On shape functions ===
1372 Again, the shape functions feel very old and were grabbed from my internal control. Tonight I was thinking about a new way to do this and it involves being able to wrap GeoJSON objects with jQuery collections and intercept $.fn calls such as .css. Also, non-jQuery UI functions can be added to the geomap widget's div to replace the old addShape method.
1373
1374 For example: $("#map").geomap("addShape", geoJson) could be $("#map").append(geoJson).
1375
1376 How would I add shapes to specific services in the future? $("#map [data-geo-service='OSM']").append(geoJson) maybe.
1377
1378 This might be going too far. Perhaps the old way is fine but use newer names (without the Shape suffix): $("#map").geomap("append", geoJsonObj), $("#map").geomap("append", "OSM", geoJsonObj), $("#map").geomap("remove", geoJsonObj) and $("#map").geomap("empty").
1379
1380 SUGGESTION: Rename the shape manipulation methods
1381
1382 The methods also need to take arrays of GeoJSON objects as returned by databases and jQuery collections of GeoJSON objects as possibly returned by the find method.
1383
1384 SUGGESTION: Shape manipulation methods should handle arrays
1385
1386 Looking back at the above code, I feel like maybe if I really can get the selector-based way to work, e.g., intercept the append call on the geomap widget, I could target the services using a class. They are divs inside the map, I should be able to trap them:
1387
1388 $("#map .OSM").append(geoJsonObj);
1389
1390 That does look really nice.
1391
1392 SUGGESTION: (future) Trap existing jQuery calls: append, remove and emtpy, on both the widget element and the service elements as syntactic sugar, forward them to geomap calls
1393
1394 However, using the class selector feels wrong. Especially if I'm telling them to use the id property when creating the service objects. I could switch it to name when creating the service objects, then:
1395
1396 $("#map [name='OSM']").append(geoJsonObj);
1397
1398 I need to find out if any of this is possible as soon as possible. It's still shorter than calling geomap. I would have to warn users to make sure the space is there, this needs to be a descendant selector.
1399
1400 SUGGESTION: Use name instead of id in the service objects.
1401
1402 === On finding shapes ===
1403 So you can append and remove shapes. Fine. But I also want a better way to search for shapes. Chris and I mulled over a selector-based way. I think I still want the simplicity of $("#map").geomap("find", position, pixelTol). That will cover a lot of use cases, users click maps a lot.
1404
1405 However, there should be other ways to get at your shapes in a UI widget way:
1406 $("#map").geomap("find", [-67, 43], 8); // find all shapes within 8px of the map position (special case)
1407 $("#map").geomap("find", "[type='Point']"); // Finds all points
1408 $("#map").geomap("find", "[name='OSM'] *"); // all shapes in the OSM service (future)
1409 $("#map").geomap("find", ":intersects(wkt(POINT(-67 43)))"); // Advanced spatial filter, OGC selector names (way future)
1410
1411 Here's how they would look with the future jQuery syntactic sugar:
1412 $("#map").find([-67, 43], 8); // find all shapes within 8px of the map position (special case)
1413 $("#map").find("[type='Point']"); // Finds all points
1414 $("#map [name='OSM']").find(); // all shapes in the OSM service (future)
1415 $("#map").find(":intersects(wkt(POINT(-67 43)))"); // Advanced spatial filter, OGC selector names (way future)
1416