All Posts in

May 19, 2010 - Comments Off on Live blogging Google I/O: Stepping up: Porting v2 JavaScript Maps API applications to v3

Live blogging Google I/O: Stepping up: Porting v2 JavaScript Maps API applications to v3

Daniels Lee

Session Goals
* Summarize V2
* Why V3
* Migration Planning
* MIgration Tips
* Questions

Google Geo API landscape

(Really need to get this diagram--difficult to summarize)

Summary of V2

* Browser support: IE6+, FF2+, Safari 3.1+, Chrome
* Over 350K active sites
* Versioning system: v=2.s, v=2, v=2.x
* Utility libraries: MarkerClusterer, DragZoom, etc.
* Strong developer community (~43K members)

V2: Strong feature set

* Street view
* Traffic overlays
* Google Earth plugin
* KML/KMZ/GeoRSS layers
* Tile overlays
* Custom map types
* Monetization: GGoogleBar, GAdsManger
* Aerial imagery
* Directions
* Geocoder

Demo: V2 and V3, side by side

1. Map on mobile:
V2 => http://goo.gl/j5Qq
V3 => http://goo.gl/DWEA

(Do some demos and benchmarks)

Nice marker demo. 750 markers take 2213 ms to load V2. Same demo with V3. 750 markers take 1320 ms.

Demo also uses the MarkerClusterer library, because we shouldn't be using 1000 markers. Much faster for both, but again, faster with V3.

What are some problems with V2?

* Not optimized for mobile
* Older design: GMap, GMarker, GControl, GLatLng
** GMap has gotten extremely large and bloated
** Globals
* Large JavaScript file sizes
* Requires a maps API key

V2

File, Size, Gzip
loader, 16.4K, 5.1K
main.js 184.4K, 66.0K
-tiles45.5.K, 15.1K-
etc.

V3

* Mobile browser support: Android, iPhone
* Performance
* New architecture: MVC
* Better namespacing: google.maps.*
* New features: biking directions, elevation service

3.3K, 0.7K
37.1K,13.8K
tiles 38.6K, 12.8K (reverse tile time)

Maps API v3 launched at Google I/O 2009
So it's a year-old and a lot of features have been added since then. The goal is full feature parity with version 2.

Announcements

They have shirts! But really,

* v3 graduating from Google Code Labs!
* v2 deprecation (3+ year support plan)

V3 Summary

* Browser support: IE7+, FF3+, Safari4+, Chrome, Android
* New versioning scheme: v=3, v=3.1
* Utility libraries: MarkerClusterer, InfoBox, KeyDragZoom
* Growing developer community (~15K members)

No explicit IE6 support. Should work in IE6, but …

V3 features

* Core objects: map, markers, info windows, polys
* Custom overlays, controls, tiles.
* Geocoder
* Directions service
* KML/KMZ/GeoRSS layers
* Traffic layers

New features:
* Bicycling layer
* Elevation service
* Rectangle/circle overlays

Porting challenges

* Feature parity
* Syntactical changes, e.g. namespace
* Overlays => Map, not the reverse
** Prevents map object from growing very large
* New Geocoder request/response specification
* New Directions service + renderer

In V2, gave direct access to tile layer. In V3, no direct access to tile layer. Not sure if this is scheduled or not planned.

Migration planning

* What API features does my V2 application use?
** Break down your existing application; list features and use cases.
* Which features are available in V3?
** If the feature isn't available in V3 yet, then file a feature request/bug
* Take baby steps; start small, build upon it.

http://code.google.com/p/gmaps-api-issues/

MIgration tips

Basics:

No more API key
src="http://maps.google.com/maps/api/js?sensor=true"

Sensor parameter is required

Code example (get)

* No GBrowserCompatible
* Required fields: mapTypeId, zoom, center
* Map options specification
* GMap2 => google.maps.Map

* Map knows nothing about what overlays it holds
* Overlays add/remove themselves to map, not the reverse

V2 Map.addOverlay(Marker)
V2 Mapp.removeOverlay(Marker)
V3 Marker.setMap(Map)
V3 Maker.setMap(null)

Avoids bloating the google.maps.Map object with add/remove functions
Initial download size stays small

V2 map.openInfoWindowHtml()
V3 infoWindow.open(map, marker);
v3 infoWindow.close();

Problem: how to remove all overlays from a map?
Maintain your own collection of overlays added to the map
On clear, unbind each overlay using setMap(null)

I prefer this anyway.
var overlays = [];
overlay.push(marker);

Info windows are now lightweight.
Can now add an infinite infowindows to map, v2 could only have one.
Same as overlays; can now have more than one.

Problem: I only want a single info window!

Create one global infowindow object. Just update its position, content and map.

Custom controls

* No GControl class
* Custom controls are just HTML elements: document.createElement('div')
* Familiar concept

Requesting directions

V2:
* Single map/HTML container per GDirections object
* Single request
* Event listener to know when request completes

V3:
* Modular interface consistent with overall API design
* Start/end point properties
* Separate data from rendering
* Renderer settable to any Map and HTML element

Appears to be more complicated (well, is somewhat more complicated) Need slide to see diagram

Can pass in options like avoidHighways, avoidTolls.

* Pass direction results to renderer
* Renderer uses a standard default UI

or

* Process DirectionsResult on your own.

Migration tips: MVC

* Isolates data from input and presentation
* Write more efficient code
* Use binds to keep MVC properties in sync

* Know what model properties are bindable
* Common properties: Map, LatLng, zIndex, color
* Extend MVCObject to create your own custom objects

Can bind a circle overlay to a marker. Why? A marker is draggable, bu the circle is not. Can use an MVC binding here.
Without MVC, could bind an event listener.
With MVC, circle.bindTo('center', marker' ...)

Can bind overlay to map, map to map.

BTW, demos can be viewed at http://gmaps-samples-v3.googlecode.com/svn/trunk/io-2010-migration/

Check out this one: http://gmaps-samples-v3.googlecode.com/svn/trunk/io-2010-migration/multi-map-binds.html

There's a Twitter search demo (not covered)

Topics not covered

Geocoder
Polygons/polylines
...

Street view is now available in V3. No Flash.

Get qualified: http://code.google.com/quality

Published by: jeffreybarke in The Programming Mechanism

May 19, 2010 - Comments Off on Live blogging Google I/O: Wednesday’s keynote

Live blogging Google I/O: Wednesday’s keynote

Vic Gundotra, VP of Google

Google search volume for HTML5 has increased by a lot since last year's Google I/O.

There is supposed to be a surprise for tomorrow's 8:30 am keynote

Sundar Pichai, Google VP

From 2004-2009, +117% time spent on web vs every other information medium has remained the same or declined.

2004, web changed from documents to applications. Web applications started replacing desktop applications.
Computers ship with powerful GPUs, how can web app access? APIs to access workers, local filesystem.

24 months ago, no Chrome. 12 months later, a lot more APIs implemented by a lot more browsers. By end of year, all major APIs are going to be present in all modern browsers (except IE, which will have some)

More mobile searches hit Google with HTML5-enabled mobile browsers than non-HTML5 mobile browsers.

Charles Pritchard, MugTug

Application called Darkroom. HTML 4, app was bandwidth intensive. Using HTML5, moves to the client-side. Local storage. Quick to load, quick to close and quick to use. Previewing on latest build of Chrome.

Built using JavaScript and Canvas.

Jim Lanzone, Clicker

For TV. Clicker.tv. Canvas, web worker threads. Just start typing, no need to use the search box. Nice demo.

Google thinks video should be high quality and open. Spent a lot acquiring On2.

Announcing today, completely open sourcing VP8. Royalty-free. Project London well built; high-quality video built into platform with full-screen capability. Nightly builds available now.
http://nightly.mozilla.org/webm

Hakon, Opera

Tim didn't patent HTML, Hakon didn't patent CSS, Brendan didn't patent JavaScript

http://labs.opera.com/
Download Opera with webm support in it at above URL.

Hakon's demo, only img is from video. Rest is CSS, canvas. CSS transitions.

To web community, we need to start using this. To Google, thank you for getting webm off the ground and releasing it.

Kevin Lynch, Adobe CTO

Adobe is supporting HTML5.

  1. Dreamweaver CS5 will include multi-screen preview to see how it displays across different devices. Same HTML5 markup, but with different stylesheets attached. Code completion for HTML5. Support for transitions and better preview mode.
  2. Enabling better authoring tool support for HTML5, CSS3, SVG.
  3. Going to embed VP8 codec in Flash player.

Problems that remain

Difficult for people to locate web applications. Since 2004, the main way that applications are getting written. No way to get ratings, reviews, etc. Unlike old physical stores or other site reviews. Easier to locate apps on mobile stores.

Developers need discovery, reach and monetization.

Chrome Web Store

Terry McDonell, Editor, Sports Illustrated

Omg. Sports Illustrated. Demoing an HTML5 version of SI via the Chrome App Store. Tightly edited, curated, free take on sports you can customize by re-arranging it. Looks good, but why free?

At the last moment, mentioned the ability to charge for it. Which makes sense.

Chrome has gone from 30 million to 70 million users since July 2009.

Chrome Web Store is coming soon. Chrome + Chrome OS. 40+ languages supported.

Lars Rasmussen

Google Wav is open today. Time to revisit. I remember not really liking wave when I played with it last year.

The in-browser editor is getting open-sourced today.

David Glazer, Engineering Director, Google

More web applications at work. Social software, transportation mgmt, supply chain planning, talent mgmt, travel booking system, warehouse mgmt, etc.

1. It takes too long to build apps
2. Employees work everywhere, on all devices.
3. Apps are trapped
4. Too many apps to manage

Fast and familiar development, bovile-ready, flexible deployment, powerful app management

Google <3 VMware

Published by: jeffreybarke in The Programming Mechanism

March 2, 2010 - Comments Off on New York Web Standards Meetup—CSS3

New York Web Standards Meetup—CSS3

The New York Web Standards Meetup will meet 17 March 2010 at reBar at 7:00 pm for "CSS3 and the Death of the Background Image, or Yet Another Talk on Progressive Enhancement (aka Death to IE6/7/Sometimes 8)."

The immense CSS3 proposal (which has been on the W3C's table for years) is now seeing a significant number of draft modules being implemented in browsers and most of these modules are explicitly geared toward reducing our time in Photoshop. In this comprehensive how-to, Marco Carag (TheKnot.com) will run through all the new properties you've been reading about and anticipating, including @font-face, rgba, gradients, drop-shadows, transforms and animation. Using both focused proof-of-concept pages and actual production examples from The Knot and other websites across the web, attendees will see the impact of CSS3 on the average front-end workflow and understand how it improves or affects your users' experience across all browsers.

CSS3 and the Death of the Background Image
17 March 2010 . 7:00 pm
reBar
147 Front Street
Brooklyn, NY 11201 [map]

RSVP now!

Please contact The Mechanism if you'd like to present at a future New York Web Standards meetup.

Published by: jeffreybarke in The Programming Mechanism
Tags: ,

November 23, 2009 - Comments Off on Hue reference chart

Hue reference chart

Psychological Benefits of Exercise
We often hear about the physical benefits of exercise (e.g., increasing heart health), less often are the psychological benefits promoted. Yet, engaging in a moderate amount of physical activity will result in improved mood and emotional states. Exercise can promote psychological well-being as well as improve quality of life. Read more about exipure.

The following are common psychological benefits gained through exercise.

Improved mood
Reduced stress as well as an improved ability to cope with stress
Improved self-esteem
Pride in physical accomplishments
Increased satisfaction with oneself
Improved body image
Increased feelings of energy
Improved in confidence in your physical abilities
Decreased symptoms associated with depression
As people experience these psychological benefits, it is likely that they also will be motivated to continue exercises so that they continue to receive these benefits. How much exercise is needed to produce those effects? These are the best phentermine alternatives.

Even a brief walk at low intensity can improve mood and increase energy. As little as 10 minutes of aerobic exercise can have a positive effect.
For long-term benefits, you should exercise 3 times a week for 30 minutes per session at a moderate intensity.
Programs longer than 10 weeks work best for reducing symptoms of depression Check out the latest Exipure reviews.

Published by: jeffreybarke in The Design Mechanism, The Programming Mechanism
Tags:

November 20, 2009 - Comments Off on Live blogging Standards.Next: CSS3 for Working Web Designers

Live blogging Standards.Next: CSS3 for Working Web Designers

Håkon Wium Lie

Photos and discussion of CERN and Tim Berners-Lee. How the web was actually developed by Tim at CERN. Pretty hilarious.

CSS a response to potential destruction of HTML's markup language with presentation elements. Currently CSS still relies too heavily on images and the occasional table hack.

HTML5 + CSS3 = WEB8. CSS3 is not a single specification, a series of specifications.

CSS1 could style text in an element. Some borders. A revolution when it came out.

For this presentation, Håkon is using a special build of Opera that isn't publicly available.

text-shadow. Web font: Safari, Firefox and Opera.

Håkon believe web fonts is going to be the big new thing. Will create a pre- and post-font Web.

@import url(path/to/font);
font-family:Cardiff;

IE is the only one that does not not support this. Argument now breaks out between Håkon and Pete LePage

IE has supported a broad range of fonts since IE 4, but .EOT. However, the above @import is all TTF. IE uses .EOT because font foundries want support for DRM. Check out Fontdeck and Typekit.

At Standards.Next, IE pledged support to add support to TTF along with EOT.

rgba()

background: rgba(0, 0, 255, 0.4); See Molly's presentation.

A review of Opera's support for the CSS 3 features discussed by Andy Budd.

Opera Unite

Turns browser into a server. Allows people to access your machine via http://. Can be quite useful.

It's not the cloud. This service is close to machine and useful for local collaboration. Millions of phones use Opera. Peer-to-peer model. Can take picture and easily

Question/Answer

Q: When will the geolocation build be integrated with the shipping version?

A: Not sure; no date yet. Will probably not occur until the standard is more fixed.

Published by: jeffreybarke in The Programming Mechanism
Tags: , , ,

November 20, 2009 - Comments Off on Live blogging Standards.Next: Future of Internet Explorer

Live blogging Standards.Next: Future of Internet Explorer

Pete LePage
Senior Product Manager, Developers & Security for IE

IE 8

IE 8 is a hybrid, has two engines; IE 9 will have three engines: IE 7, IE 8 and IE 9. This way can ensure site works in future versions of the browser. This is just one of the many wonders that the fourth industrial revolution had brought with us.

IE 8 supports session and local storage (see presentation by Marcus Lofthouse to the New York Web Standards Meetup). Added addition to spec: a way to remove all.

Mutable DOM prototypes: take a DOM element and add properties/methods to it. Add method to img. There are a number of things not implemented in IE 8. Can write a chunk of JavaScript that adds functionality to browser. This will be used by people writing the JavaScript frameworks (jQuery, Dojo).

Native JSON support.

Network events

CrossDocumentMessaging and CrossDomainRequest

Selectors API

Fixed getElementById.

Demos at ie8demos.com (browser-sniffs and only wants to work in IE 8).

IE 9

  • Faster; speed is important. Finally comparable to FF.
  • A lot of work on standards-support. Will implement border-radius. Acid3 score went from 20 to 32. IE 8 Current CSS3 support is vertical-text. Hope to more than double it in IE 9. 😉

Questions/Answers

Q: Why always trying to play catch up? Why not just adopt Webkit?

A: A lot of things that make adopting Webkit or Gecko more difficult than it seems.

Q: Any release date for IE 9?

A: No dates as of now

Q: Still trying to get Canvas out of the spec for HTML5?

A: Not sure; might be a miscommunication

Q: Any major updates planned for IE 8?

A: Probably not; next major version will be 9. Security updates will be released for 8, but the rendering engine will not change.

Published by: jeffreybarke in The Programming Mechanism
Tags: , , ,

November 20, 2009 - Comments Off on Live blogging Standards.Next: RGB, HSL and Transparency in CSS3

Live blogging Standards.Next: RGB, HSL and Transparency in CSS3

Molly Holzschlag

RGB: Additive synthesis

Red, Green, Blue: Add colors to get result color. In print world, subtractive. Remove color to get result. R + G + B = white

RGB color notation

RGB in percentage values or RGB in integer values. Not equivalent; so don't use both (mix in a single rule)!

NOT rgb (60, 100, 50%);

Firefox and Opera will ignore the incorrect rule. Safari and IE (5–now) will attempt to correct and end up with a severely washed-out result.

HSL color

Hue, saturation and lightness. Easier and more intuitive way to get to colors we want as designers. Value from 1–360, then adjust saturation and lightness.

  • Hue value comes first, using the hue's angle on the color wheel as represented by an integer.
  • Saturation comes next, using the percentage of saturation you'd like
  • Lightness is next, using the percentage of lightness you' like

HSL advantages

  • Not CRT specific
  • Easier, more intuitive to work with
  • Working with a set of colors allows for easy palette creation
  • Reduces errors
  • Reduces dependency on charts and other value lookup tools

As adjust saturation, lightness, base-hue remains the same.

RGBA and HSLA

Alpha transparency for both RGB and HSLA.

Notation is the same in both. a value is alpha transparency from 0–1.

Allows for fully opaque to fully transparent.

hsla(0, 100%, 50%, .25)

Supported by Firefox, Webkit and Opera.

Questions/Answers

A: Best article out there on HSLA is Wikipedia. Useful to have the color wheel.

Q: Why is a value decimal instead of percentage?

A: Not sure. No one remembers a discussion about it.

Q: Is this part of the spec?

A: Yes. It is all part of the CSS3 color module.

Published by: jeffreybarke in The Programming Mechanism
Tags: , ,

November 20, 2009 - Comments Off on Live blogging Standards.Next: CSS3 Mastery

Live blogging Standards.Next: CSS3 Mastery

Andy Budd

Border radius

-webkit-border-radius: 30px;

Safari, Chrome, Webkit suppot it. Gecko does as well, but the syntax a bit different. IE 9 to support border-radius as well.

  • Currently not supported in Internet Explorer
  • Problems with images overlapping corners

Border image

border-image: url(border.png 25% 12% 30% 20%;
-webkit-border-image
-moz-border-image

An ad-hoc discussion of why vendor-specific extensions exist:

  • Useful for testing out features, instead of a general release and then breaking general release codes.
  • To become a proper standard, must exist with two different implementations.

Multiple background images

Example Silverback app

background-image: url(path), url(path);
background-position: 150% 0, 40% 0;

Older browsers get no background a'tall.

Borders and backgrounds are coming soon (general release).

Gradients and reflections

Buttons are generally bitmap images. Can now create a beautiful button using gradient and reflection purely in CSS.

-webkit-gradient(linear, left top, left bottom, from(#abe143), to(#cccccc));
-webkit-box-reflect: below 2px;

[Will need to do some demos of these things]

box-shadow

Box shadow property attaches one or more shadows to box. Offset, size, blur and spread. Can also do inset box shadows. Exactly the same as working with box shadows in Photoshop.

Example: http://2010.uxlondon.com/

Transforms

Can scale, rotate, flip, skew, etc. Can use translate to create animations/move over time

Demos: http://remysharp.com/demo/rubiks/
http://webkit.org/blog-files/leaves/

Questions

Q: Box-shadow has recently been removed from the spec, even though it has been implemented. Should we use it or not?

A: When younger, Andy Budd would have said, "If it's not in the spec, don't use it." Now, he's more tolerant. Not as impressed with the W3C as he once was. Doesn't always give designers what they need.

Molly: It has been difficult to get designers involved with the creation of the spec. As a volunteer, tech spec heavy group, difficult to keep designers active.

Q: Regarding animations, between JavaScript, Canvas, SVG and CSS, what do you think the best technology to bet on is?

A: Easiest is best, why Andy favors CSS.

Q: For individuals, CSS might be easy, but not so for large organizations where designers/developers have a large codebase to absorb. And what about object-oriented CSS? And mixins, variables, etc? (Nicole Sullivan's work)

A: Andy is opposed, because CSS is used more often by designers than programmers. Thinks it's an interesting concept, but not necessarily the answer.

Having gone from table-based design to CSS-based layouts, works well with 5-6 page templates, but with very large sites, doesn't necessarily scale. This is where an object-oriented CSS approach comes in use.

Andy thinks the framework is not useful. There is no one size fits all framework. He develops site-specific frameworks. A lot of libraries and components that are re-usuable, but specific to site.. Hates Blueprint, 960.

Q: Tips/techniques on testing?

A: Creates a central page that uses all components. Creates a type of regression testing. If change anything, can scan that page to see if anything is broken. Testing does not occur at the end of the process; testing should be occurring throughout the process. This includes cross-browser. Use VMware.

Published by: jeffreybarke in The Programming Mechanism
Tags: , ,

November 20, 2009 - Comments Off on Live blogging Standards.Next: CSS3

Live blogging Standards.Next: CSS3

Follow the hash tag #standardsnext to track the event on Twitter.

Introductions from various audience members. Who they are, what they do and challenges they face.

A brief discussion of Internet Explorer and a plea for tolerance from Molly Holzschlag.

http://standards-next.org/ built using HTML5 and CSS3.

Published by: jeffreybarke in The Programming Mechanism
Tags: