From b429a422185206c645c84ec1c3540494d336b943 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 13 Dec 2011 05:10:23 +0000 Subject: add latitude/longitude to prospects, customers and package locations, RT#15539 --- httemplate/view/map.html | 120 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 httemplate/view/map.html (limited to 'httemplate/view/map.html') diff --git a/httemplate/view/map.html b/httemplate/view/map.html new file mode 100644 index 000000000..71a153842 --- /dev/null +++ b/httemplate/view/map.html @@ -0,0 +1,120 @@ +<& /elements/header-popup.html, { + title => '',#$name, + head => $head, + etc => 'onload="html_googlemaps_initialize()"', + nobr => 1, + } +&> + +<% $map_div %> + +<%init> + +my $name = js_string( scalar($cgi->param('name')) ); + +my $point = [ map scalar($cgi->param($_)), qw( longitude latitude ) ]; + +my( $head, $map_div ) = onload_render( + $name, + map scalar($cgi->param($_)), qw( lat lon ) +); + +#false laziness w/Mason.pm +sub js_string { + my $string = shift; + $string =~ s/(['\\])/\\$1/g; + $string =~ s/\r/\\r/g; + $string =~ s/\n/\\n/g; + $string = "'". $string. "'"; + return $string; +} + +#subroutines below derived from HTML::GoogleMapsV3, but without using +#Geo::Coder::Google or GPS::Point +sub onload_render +{ +## my $self = shift; + my( $name, $latitude, $longitude ) = @_; + + #map_canvas { height: 100% } + + my $header=' + + + + '; + + + #my $div = '
'; + my $div = '
'; + + + $header .= ""; + + return ($header,$div) + +} + + -- cgit v1.2.1