Alpha 4 released!

It’s been a long three months but we’re very happy to announce the release of jQuery Geo 1.0a4! Here are some highlights and details:

At the service level

In alpha 3, you could append and interact with shapes on the map. In alpha 4, this is extended to services! Service-level shapes have their own shapeStyle apart from the map’s and hide when their service is hidden.

More modes!

There are new modes to let you measure distance & area, and a static mode for when you want to display a map but not let users interact with it. Apart from the three new built-in modes, you can also create custom modes to help organize your app.

What’s that? CSS labels!

You can now give any shape a label when you append it. You can style the label from your regular style sheet using the .geo-label class which opens labeling up to all the design power of CSS3. There’s even more potential if you put a class or id on your map service because you can target labels on different services using CSS rules. Also, labels can be any HTML which opens them up to new features in HTML5!

More service src options

The old getUrl property has been renamed to src (see Breaking below) and you can now set it to a string template. jQuery Geo will stick your tile row, column, zoom, or image bbox in for you. Services defined as a string are a little easier on the eyes than a function and can be stored as JSON data.

You can still use a function and the function can now return a jQuery Promise to delay loading of the map image or tile. Want to calculate a Mandlebrot image in a JavaScript web worker without blocking user interaction? Return a new jQuery.Deferred() and call resolve when you’re done!


This version has better mobile support including pinch zoom on iOS and Android 3+ as well as other bug fixes for mobile devices.

Don’t worry about $.geo.proj so much

You can now send either geodetic (lon, lat) or projected (x, y) coordinates to any library function and it will return accordingly if you stay on the default web mercator projection. You should still set it to null or implement the (to|from)GeodeticPos functions if you need to change projections.


There is one deprecation (a service object property will be renamed in beta) and one minor breaking change.

To align this API with HTML itself, the getUrl property on service objects will be renamed to src. Using either src or getUrl will work for this alpha release but getUrl will be removed for beta. Please update any map services to use the new src property when you’re defining them.

Also on service objects, the initial opacity and visibility are in a property of the service object itself named style. Your old services will still function but ones you may expect to be hidden initially will be visible until you update the service object.

To exemplify both of these changes, instead of:

{ type: "tiled", getUrl: function( view ) { return ""; }, visibility: "hidden" }

you should write:

{ type: "tiled", src: function( view ) { return ""; }, style: { visibility: "hidden" } }

Everything else

With over 60 commits, there are more features and bug fixes to write about. If you dare to click the link below (or read the README file on the project’s GitHub page) you can get a better idea of what went into this build. This is the last alpha release (!) and the path to beta will add unit testing, a better build process, and smaller, more refined source code. Thanks for all your support!

  • geomap – [bug] changing the tilingScheme doesn’t update pixelSize, maxPixelSize, center or centerMax
  • geomap – [bug] shingled services throw exception during resize
  • docs – geomap – axisLayout option
  • geomap – axisLayout option
  • docs – upgrade to jQuery Mobile rc3
  • docs – allow page refreshing
  • docs – geomap – more modes: measureDistance, measureArea, static
  • docs – geomap – append label argument
  • docs – geomap – toPixel/toMap should take all coordinate dimensions like the proj functions
  • geomap – toPixel/toMap should take all coordinate dimensions like the proj functions
  • geomap – move the drawing container instead of individual points during pan
  • geomap – [bug] drawStyle resets after window resize
  • geomap – append label argument
  • docs – geomap – measureLabels option
  • geomap – measureLabels option
  • geomap – measureDistance mode
  • geomap – measureArea mode
  • docs – geomap – service-level shapeStyle
  • docs – geomap – getUrl string option
  • geomap – [bug] create doesn’t clear drawing shapes
  • docs – geomap – service-level shapes
  • docs – geo – detect geodetic coordinates and call $.geo.proj automatically, don’t require devs to set $.geo.proj to null
  • docs – geomap – add projection section explaining how bbox & center affect map unit type
  • docs – geomap – rename getUrl to src
  • docs – geomap – scroll option
  • docs – geomap – pannable option
  • geomap – src string option
  • examples – string service src
  • geomap – [bug] map tracks mouse when not panning if click on other elements
  • geomap – pannable option
  • geomap – scroll option
  • geomap – [bug] shapesContainer is being cleared twice during mouse wheel zoom
  • geomap – support pinch zoom on iOS
  • docs – geo – add recenter function for bbox
  • geomap – static mode
  • docs – geomap – allow Deferred or Promise as return value from src function
  • geomap – [bug] widget factory merges first service with default sometimes causing exceptions with shingled services
  • geomap – allow Deferred or Promise as return value from src function
  • geomap – [bug] resize event triggered too many times during resize
  • geomap – service-level shapes
  • geomap – service-level find
  • geographics – add a resize method, call from geomap.resize
  • geo – add recenter function for bbox
  • geomap – [bug] errors creating second un-tiled map after destroying a first on same element
  • geomap – refresh shouldn’t request new images if the map element is hidden
  • geomap – [bug] delayed multitouch isn’t nearly as smooth as true multitouch
  • geomap – [bug] tiled pinch zoom isn’t smooth
  • geo – detect geodetic coordinates and call $.geo.proj automatically, don’t require devs to set $.geo.proj to null
  • geomap – [bug] mouse wheel doesn’t work with jQuery 1.7 ** upgrade to latest jquery.mousewheel plugin
  • geomap – service object visibility and opacity options should be moved to a style property
  • geomap – use _currentServices in all functions unless we actually need to update the public options services object
  • geomap – don’t change user’s service objects in opacity/toggle
  • geomap – show attr text
  • docs – geomap – selector argument to find method
  • geomap – selector argument to find method
  • geomap – pan mode should use a hand cursor by default
  • geomap – [bug] only services that have finished refreshing move when the user pans ** for a4: hide unfinished services
  • geomap – [bug] a user can mess with the center option, e.g., convert numbers to strings, and it can wreck havoc with map state
  • geomap – [bug] zoom option doesn’t return proper values for shingled services
  • geomap – [bug] non-tiled maps can zoom out past zoom 0
  • geomap – don’t request tiles that are -y index
  • geomap – [bug] initializing tiled map by non-geodetic bbox always causes zoom level 0
  • docs – geomap – empty string needed for label element
  • geomap – [bug] double tap to end shapes adds two points before ending the shape, in different places
  • geomap – [bug] lifting fingers after pinch zoom in drawLineString or drawPolygon modes sometimes adds fake visual coordinate on touch point last lifted
  • docs – upgrade to jQuery 1.7.2
  • geomap – [bug] scroll=off doesn’t zoom map but also doesn’t allow document scroll
  • geomap – [bug] changing mode does not reset measure drawing
  • geomap – [bug] jQuery UI Widget Factory no longer passes pageX & pageY event properties during _trigger when using jQuery 1.7 ** upgrade to Widget Factory 1.8.17
  • examples – all demo (shingled)
  • docs – geomap – custom modes
  • examples – all demo (tiled)
About Author: ryanttb

Comments are closed.