[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Re: Getting a Google Maps' map for an entry
From: |
Thierry Volpiatto |
Subject: |
[Orgmode] Re: Getting a Google Maps' map for an entry |
Date: |
Wed, 30 Jun 2010 07:28:59 +0200 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) |
Julien Danjou <address@hidden> writes:
> On Tue, Jun 29 2010, Memnon Anon wrote:
>
>> It would be nice the initial zoom level of a map would be set right at
>> the beginning.
>
> The problem is that this is not possible. The zoom level, if not
> specified, is determined automatically by Google Maps, and we have no
> clue about its value.
>
> Therefore you need to press 'w' (with an eventual prefix) to set a first
> zoom level.
Specifying zoom level at startup seem to fix the problem:
,----
| (defun google-maps (location &optional no-geocoding)
| "Run Google Maps on LOCATION.
| If NO-GEOCODING is t, then does not try to geocode the address
| and do not ask the user for a more precise location."
| (interactive
| (list
| (if (use-region-p)
| (buffer-substring-no-properties
| (region-beginning) (region-end))
| (read-from-minibuffer "Location: "
| nil nil nil nil
| (replace-regexp-in-string
| "\n" " "
| (or (thing-at-point 'sentence) ""))))))
| (let ((location (if no-geocoding
| location
| (google-maps-geocode-location location))))
| (google-maps-static-show :zoom google-maps-static-default-zoom
| :markers `(((,location))))))
`----
I use 10 as default value for `google-maps-static-default-zoom'.
--
Thierry Volpiatto
Gpg key: http://pgp.mit.edu/