Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Squeak Smalltalk TiledMaps package
Last updated at 7:26 pm UTC on 30 November 2019
https://eighty-twenty.org/2018/02/11/squeak-tiledmaps

http://squeaksource.com/TiledMaps.html

It’s a package for Squeak Smalltalk. It can load and cache static, prerendered map tiles from a variety of sources including OpenStreetMaps, Bing Maps, and so on.

It includes a geocoder query service which maps free-text queries to regions of the planet’s surface. The service can be backed by the Nominatim service (associated with OpenStreetMaps), the Bing geocoder, the Google geocoder, and so on.

Selection of tilesets is independent of selection of geocoder, so you can mix and match.

The package includes a “slippy map” morph called TiledMapMorph, that allows interaction with a map using the mouse. It includes a few hooks for EToys, too, so EToys scripting of the map is possible.


To install it in your Squeak 6.0alpha image, first update to the latest trunk version:
(The same procedure is tested working in Squeak (current) 5.2 on 30-Nov-2019 [NMI] )

 MCMcmUpdater updateFromServer

Then load the TiledMaps package from SqueakSource:

 (Installer repository: 'http://squeaksource.com/TiledMaps')
    install: 'ConfigurationOfTiledMaps'

Once it has loaded, open a new TiledMapMorph with

 TiledMapMorph new openInWorld

https://www.youtube.com/watch?v=T_TDhAAxuy0&feature=youtu.be



Tony Garnock-Jones
Tue, Feb 13, 2018 at 7:04 PM
Reply-To: The general-purpose Squeak developers list
To: The general-purpose Squeak developers list , Eliot Miranda

Hi Eliot,

On 02/13/2018 05:16 PM, Eliot Miranda wrote:
> would you be happy to see your video linked to, with prominent
> billing, from a suitable page on the squeak.org site?

Sure, that'd be cool!

> Also it would be great so see an article, perhaps a blog post, that
> shows how promises simplified the implementation and how promises are
> "merely" a piece of normal Smalltalk programming that did not require
> changing the language to integrate.
That's a good idea, too.

I don't know if "not changing the language" is very impressive, though?
Javascript's promises don't need language changes either; and
implementing Squeak-like promises for other languages would be similar.

But the heart of the change from "loading tiles blocks the UI and gets
incredibly annoying" to "smooth scrolling with lazy loading" was very
small, and that might be worth an article.

It was, at heart, this change: from

    ^ tileSource mapTileAt: point zoom: zoom

to

    | p |
    p := Promise new.
    [ p resolveWith: (tileSource mapTileAt: point zoom: zoom) ] fork.
    ^ p

plus adding

    self tilesDo: [:tile :formPromise |
      formPromise whenResolved: [ self changed ] ].

whenever the coordinates to be shown were changed, and using
`formPromise value` instead of `form` in `drawTilesOn:`, rendering a
loading tile when the promise wasn't ready yet.

The LRUCache then stored Promises, which were reused frequently until
the cache evicted them, instead of storing Forms directly.

Tony