{"id":1220,"date":"2018-01-19T19:22:34","date_gmt":"2018-01-19T19:22:34","guid":{"rendered":"http:\/\/goofy-trucks.flywheelsites.com\/interactive-image-maps\/"},"modified":"2018-01-19T19:24:37","modified_gmt":"2018-01-19T19:24:37","slug":"interactive-image-maps","status":"publish","type":"post","link":"https:\/\/phpbuilder.com\/interactive-image-maps\/","title":{"rendered":"Interactive Image Maps"},"content":{"rendered":"<div class=\"phpbuilder-content\">\n<div class=\"phpbuilder-meta\">\n<div class=\"\">By Pablo Monroy D&#8217;Croz<\/div>\n<div class=\"\">on July 30, 2000<\/div>\n<\/p><\/div>\n<div id=\"overflow-content\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/phpbuilder.com\/wp-content\/uploads\/2018\/01\/pablo.jpg\" class=\"articleAuthorImg\" alt=\"picture of Pablo\" width=\"80\" height=\"92\" align=\"left\"\/><\/p>\n<div class=\"articlePara\">\nI&#8217;m working to develope a web-based Geographical Information System (GIS)<br \/>\n  and one of the big problems I had was to write an easy algorithm to zoom a portion<br \/>\n  of a map.<\/div>\n<div class=\"articlePara\">\nFirst of all I tried to use Server Side Maps, but I found that they need a<br \/>\n  Perl script with too many lines of code. So I came to phpbuilder and found an<br \/>\n  article from Rasmus Lerdorf : <a href=\"rasmus19990124.html\" target=\"_blank\">Creating<br \/>\n  Dynamic Images with PHP<\/a> that shows how useful PHP and the GD library could<br \/>\n  be for that purpose. <b>Thanx Rasmus!<\/b><\/div>\n<div class=\"articlePara\">\nI&#8217;ll explain a method to zoom a portion of an image by using PHP and gif files.<\/div>\n<div class=\"articlePara\">\nThe first step is to generate a map in its big size (in my example a 747&#215;360<br \/>\n  pixels gif called <i>caligran.gif<\/i>), then I resize the map to its small size<br \/>\n  (200&#215;96 gif called <i>cali.gif<\/i>). It&#8217;s very important to work with gif files<br \/>\n  because GD library can manipulate only those image types.<\/div>\n<div class=\"articlePara\">\nWe need three files to work besides the gif images. The first file called <b>map.html<\/b><br \/>\n  has the small map and its code is:<\/div>\n<div class=\"articlePhpEx\">\n<font face=\"courier\"><code><span style=\"color: #000000\"><\/p>\n<p>&lt;HTML&gt;<br \/>\n<br \/>&lt;HEAD&gt;&lt;\/HEAD&gt;<br \/>\n<br \/>&lt;BODY\u00a0bgcolor=\"#CCCCCC#\"&gt;<br \/>\n<br \/>&lt;FORM\u00a0METHOD=\"POST\"\u00a0ACTION=\"ampliacion.php3\"&gt;<br \/>\n<br \/>&lt;INPUT\u00a0TYPE=\"IMAGE\"\u00a0SRC=\"cali.gif\"\u00a0NAME=\"mapa\"\u00a0BORDER=\"0\"&gt;<br \/>\n<br \/>&lt;\/FORM&gt;<br \/>\n<br \/>&lt;\/BODY&gt;<br \/>\n<br \/>&lt;\/HTML&gt;<br \/>\n<br \/><\/span><br \/>\n<\/code><\/font><\/div>\n<div class=\"articlePara\">\nThe principal purpose of this file is to transmit the coordinates where the<br \/>\n  user clicks on the small map.<\/div>\n<div class=\"articlePara\">\nHere, the most important tag is <font face=\"courier\"><code><span style=\"color: #000000\"><br \/>\n&lt;INPUT\u00a0TYPE=\"IMAGE\"\u00a0....\u00a0&gt;<\/span><br \/>\n<\/code><\/font><br \/>\nOn a browser that supports this tag, the image is displayed. Clicking<br \/>\n  on any part of the image is equivalent to clicking on a Submit button. If <font face=\"courier\"><code><span style=\"color: #000000\"><br \/>\nNAME<\/span><br \/>\n<\/code><\/font><br \/>\n  is <code class=\"example\">mapa<\/code>, the values <code class=\"example\">mapa_x<\/code> and<br \/>\n  <code class=\"example\">mapa_y<\/code> are transmitted<br \/>\n  to <b>ampliacion.php3<\/b> through normal form and URL encoding. These two fields<br \/>\n  contain the coordinates where the user clicked. <\/div>\n<\/div>\n<p><\/p>\n<div style=\"float: left; padding:15px; color:#17AAF3\">\n<div style=\"background-color:#B6E5FC; font-size:16px; margin-top:1px; padding:1px 4px 1px 4px; color:#000; font-style:bold; float:left;\">1<\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"pablo199907294658.html?page=2\">2<\/a> <\/div>\n<div style=\"float:left; padding:2px;\"><a class=\"paginationPageLink\" href=\"pablo199907294658.html?page=2\">Next Page \u00bb<\/a><\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1220","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1220","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/comments?post=1220"}],"version-history":[{"count":1,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1220\/revisions"}],"predecessor-version":[{"id":2130,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1220\/revisions\/2130"}],"wp:attachment":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/media?parent=1220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/categories?post=1220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/tags?post=1220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}