Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Google maps and Perl

by Anonymous Monk
on Sep 26, 2009 at 00:04 UTC ( #797624=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I'm looking for any information on using perl with google maps. I'm trying to find any code that will let a person move a marker and then save that new position back to a perl variable for further use. I can find a fair amount of php stuff, but very little perl. Surely there is some somewhere? Can some kind Monk point my in the right direction?

Comment on Google maps and Perl
Re: Google maps and Perl
by Anonymous Monk on Sep 26, 2009 at 00:39 UTC
    Did you check CPAN?
      Yes, Geo::Google::StaticMaps WebService::GoogleMaps Geo::Coder::GoogleMaps but none of them seem to handle taking data back in, only on outputing to GM. I may be missing something, but if someone could point me to the correct module, or some demo code on reading data back into perl from maps, that would be fantastic.
        I'm not an expert on google offerings, but I'm sure first you need to find what you're looking for on google, like http://code.google.com/apis/maps/faq.html, then you go looking for how to interface to it using perl.
        please give the example code because i am new in this field i don't know how to use these modules.
Re: Google maps and Perl
by jrtayloriv (Pilgrim) on Sep 26, 2009 at 06:52 UTC

    Look up GMarkerManager or Google Maps MarkerManager. I'm pretty sure that's what you want. If it's not what you wanted, could you please describe what you're trying to do, so we can understand the context?

    --Jesse Taylor

Re: Google maps and Perl
by SilasTheMonk (Chaplain) on Sep 26, 2009 at 21:08 UTC

    I think what you need to do is to override the dragend event of the GMarker class (http://code.google.com/apis/maps/documentation/reference.html#GMarker.dragend) to capture your move of the marker. Your function would need to make an AJAX style call to update the server of the move of the marker. So I would say about 50% of the problem is in javascript, about 20% in your markup and only about 30% in server side code (which could be perl). As such it is quite hard to encapsulate in perl. It can be done (and I was thinking of doing so for a much simpler problem) but you would have to supply a lot of javascript and HTML documentation to go along with it. You probably want to start by just making the dragend functon call "alert" before you start worring about AJAX and updating the server.

    Edit: Thinking about it, something I wrote could be extended to provide support for this. It would work with HTML::Template::Plugin::Dot (and possibly other template frameworks). As I said above, only about 30% of it would actually be perl. The other would be docs and explanation. I am a bit busy now at the moment so I would like to ask what is your timeframe? What I could do is send a private email with an explanation of what I have done and how I would adapt it to meet your needs.

    Edit 2: Also another question. You talk about "saving back to a perl variable". That does not make sense. You need to be saving back to some sort of persistent storage, though of course you might like to hide that behind a variable.

    Edit 3:New development: RFC: Geo::Google::MapObject.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://797624]
Approved by broomduster
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (13)
As of 2014-07-24 13:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (160 votes), past polls