From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: Re: Getting a Google Maps' map for an entry Date: Tue, 29 Jun 2010 15:29:51 +0200 Message-ID: <87tyom6k6o.fsf@gmx.de> References: <87y6dy6l09.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from [140.186.70.92] (port=36691 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTasm-0004VA-R7 for emacs-orgmode@gnu.org; Tue, 29 Jun 2010 09:29:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OTasl-00050a-Ji for emacs-orgmode@gnu.org; Tue, 29 Jun 2010 09:29:48 -0400 Received: from mail.gmx.net ([213.165.64.20]:53979) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OTasl-00050N-7V for emacs-orgmode@gnu.org; Tue, 29 Jun 2010 09:29:47 -0400 In-Reply-To: <87y6dy6l09.fsf@gmx.de> (Sebastian Rose's message of "Tue, 29 Jun 2010 15:12:06 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Julien Danjou Cc: emacs-orgmode@gnu.org --=-=-= Sebastian Rose writes: > Julien Danjou writes: >> Hi there, >> >> I've recently wrote a Google Maps extension for Emacs[1]. >> >> Therefore, I've extended org-mode to display a Google Maps' map for an >> event location. The extension, which is very simple, is available >> here[2] and I wanted you to know about it. >> >> I'd be glad to have feedback. patches or ideas. ;) >> >> Happy hacking. >> >> [1] http://julien.danjou.info/google-maps-el.html >> >> [2] http://git.naquadah.org/?p=~jd/jd-el.git;a=blob;f=org-location-google-maps.el;hb=HEAD > > Wow - works pefect on emacs 24! > > > 'Current zoom level is unknown' > > I guess `google-maps-static-default-zoom' is not set (possible patch > appended). > > > Thanks for sharing :) > > We where talking about GEO locations and org-mode recently: > > > > > Sebastian > > > > diff --git a/google-maps-static.el b/google-maps-static.el > index 644408d..98d9ac8 100644 > --- a/google-maps-static.el > +++ b/google-maps-static.el > @@ -332,7 +332,7 @@ PLIST can contains this properties: > "Zoom a Google map in." > (interactive) > (unless (plist-member google-maps-static-params :zoom) > - (error "Current zoom level is unknown, cannot zoom in.")) > + (plist-set google-maps-static-params :zoom google-maps-static-default-zoom)) > (google-maps-static-zoom (1+ (plist-get google-maps-static-params :zoom)))) > > (defun google-maps-static-zoom-out () Sorry, did not save before doing the `git diff'. I like this patch better anyway: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=static.default-zoom-not-set-2.patch diff --git a/google-maps-static.el b/google-maps-static.el index 644408d..89c877a 100644 --- a/google-maps-static.el +++ b/google-maps-static.el @@ -328,12 +328,20 @@ PLIST can contains this properties: (max (min level google-maps-static-maximum-zoom) google-maps-static-minimum-zoom)) (apply 'google-maps-static-show plist))) -(defun google-maps-static-zoom-in () - "Zoom a Google map in." - (interactive) - (unless (plist-member google-maps-static-params :zoom) - (error "Current zoom level is unknown, cannot zoom in.")) - (google-maps-static-zoom (1+ (plist-get google-maps-static-params :zoom)))) +(defun google-maps-static-zoom-in (&optional arg) + "Zoom a Google map in. +If the numeric prefix argument ARG is set, zoom in this much levels." + (interactive "p") + (let* ((arg (if (> 1 arg) 1 arg)) + (current (or (plist-get google-maps-static-params :zoom) + google-maps-static-default-zoom)) + (next (if (and (<= (+ arg current) google-maps-static-maximum-zoom) + (>= (+ arg current) google-maps-static-minimum-zoom)) + (+ arg current) + google-maps-static-maximum-zoom))) + (setq google-maps-static-params + (plist-put google-maps-static-params :zoom next)) + (google-maps-static-zoom next))) (defun google-maps-static-zoom-out () "Zoom a Google map out." --=-=-= Sebastian --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--