Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

EasyMap


Jack_mcs

Recommended Posts

That code was for my version. I don't support the others so I don't know what it would take for that code.

 

Jack

 

Thats odd. I downloaded EasyMapV2.3 and in the readme file it says:

EasyMap V 1.1 by Jack_mcs  12-31-05

This contribution uses the API provided by google to allow you to 
add a map to your shop. It can be used to show location and give 
driving instrucitons (although that is limited at this time). 

This contribution is not yet compatible with Simple Template System. The next version will include a STS fix.

To add in the future:
- Automatic geocoder and driving directions
- True language support for STS (<?php echo HTML_PARAMS; ?> will not work with the template system).
- 

Tested on osCommerce 2.2-CVS

/**************************************************************/
HISTORY:
V 2.1 - Fixed compatibility with STS and standard OSC
---snip---

 

I then open up the /catalog/easymap.php it says in the header:

<?php
/*
 $Id: easymap.php,v 1.1 2005/12/31 by Jack_mcs

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 

Wouldn´t that be "your" version? Or should I go back to the EasyMap V_1.1 posted in Dec 2005?

Link to comment
Share on other sites

My name is in the file because it is a copy of the original. People who update the contributions of others generally don't change that since it is taking credit away from the original author. When I say my version, I refer to the last package I uploaded, which is probably the one you mentioned with the date of Dec 2005.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 months later...

Hi, tried latest version of easymap, didn't work so when back and installed version 1.1 asin this forum it was apparently the only one to work. Everything seems fine except for where the map is supposed to be, there is only a thin frame and no map. Here is the esymap as I have it installed :

 $Id: easymap.php,v 1.1 2005/12/31 by Jack_mcs

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_EASYMAP);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_EASYMAP));

 $action = (isset($_POST['action']) ? $_POST['action'] : '');
 $line = array();
 $line = explode(",", EM_LINES_COORD);

 if (tep_not_null($action)) {  
$longitude = $_POST['longitude'];
$lattitude = $_POST['lattitude'];
 }
 else
 {
$longitude = EM_LONGITUDE;
$lattitude = EM_LATTITUDE;
 } 
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html 
xmlns="http://www.w3.org/1999/xhtml"xmlns:v="urn:schemas-microsof­t-com:vml"> 

<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">

<!-- BOC googlemap //-->
 <style type="text/css">
v\:* {
  behavior:url(#default#VML);
}
</style>
 <script src="http://maps.google.com/maps?file=api&v=2&key=keycode removed" type="text/javascript"></script>

<script type="text/javascript">
//<![CDATA[

function onLoad() {
 var map = new GMap(document.getElementById("map"));
 map.centerAndZoom(new GPoint(<?php echo $longitude; ?>, <?php echo $lattitude; ?>), 4); 

 <?php if (EM_SHOW_MAP_VIEW == 'true') { ?>
  map.addControl(new GMapTypeControl());
 <?php } ?>

 <?php if (EM_SHOW_MAP_SIZE == 'true') { ?>
  map.addControl(new GSmallMapControl());		 
 <?php } ?>

 <?php if (EM_SHOW_MAP_PANNING == 'true') { ?>
  map.addControl(new GLargeMapControl());
 <?php } ?>

 <?php if (EM_SHOW_MAP_COORDINATES == 'true') { ?>
  GEvent.addListener(map, "moveend", function() {
	var center = map.getCenterLatLng();
	var latLngStr = '(' + center.y + ', ' + center.x + ')';
	document.getElementById("message").innerHTML = latLngStr;
  });
 <?php } ?>

 <?php if (EM_SHOW_MAP_LOCATION == 'true') { ?>
  map.openInfoWindow(map.getCenterLatLng(),
	   document.createTextNode("<?php echo EM_LOCATION_TEXT; ?>"));
 <?php } ?>

 <?php if (EM_SHOW_MAP_MARKER == 'true') { ?> 
  var bounds = map.getBoundsLatLng();
  var width = bounds.maxX - bounds.minX;
  var height = bounds.maxY - bounds.minY;
  var point = new GPoint(bounds.minX + width * <?php echo EM_LOCATION_X; ?>,
						 bounds.minY + height * <?php echo EM_LOCATION_Y; ?>);
  var marker = new GMarker(point);
  map.addOverlay(marker);   
 <?php } ?>

 <?php if (EM_SHOW_MAP_LINES == 'true') { ?>	
 // Add a polyline with 5 points. Sort the points by
 // longitude so that the line does not intersect itself.
  var bounds = map.getBoundsLatLng();
  var width = bounds.maxX - bounds.minX;
  var height = bounds.maxY - bounds.minY;
  var points = [];   
  points.push(new GPoint(bounds.minX + width * <?php echo $line[0]; ?>,
					 bounds.minY + height * <?php echo $line[1]; ?>));
  points.push(new GPoint(bounds.minX + width * <?php echo $line[2]; ?>,
					 bounds.minY + height * <?php echo $line[3]; ?>));
  points.push(new GPoint(bounds.minX + width * <?php echo $line[4]; ?>,
					 bounds.minY + height * <?php echo $line[5]; ?>));						 						 
  points.push(new GPoint(bounds.minX + width * <?php echo $line[6]; ?>,
					 bounds.minY + height * <?php echo $line[7]; ?>));						 						 
  points.push(new GPoint(bounds.minX + width * <?php echo $line[8]; ?>,
					   bounds.minY + height * <?php echo $line[9]; ?>));						 						 

  points.sort(function(p1, p2) { return p1.x - p2.x; });
  map.addOverlay(new GPolyline(points));	 
 <?php } ?>
}

//]]>
  </script>
<!-- EOC googlemap //-->
<link rel="stylesheet" type="text/css" href="easymenu.css">
</head>
<body  onload="onLoad()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
  <td class="columnLeft" width="<?php echo COLUMN_LEFT_WIDTH; ?>" valign="top"><table  border="0" width="<?php echo COLUMN_LEFT_WIDTH; ?>" cellspacing="0" cellpadding="0">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td><td background="images/links/shadow_column_left.gif">   </td>
<td><?php echo tep_draw_separator('pixel_trans.gif', COLUMN_SPACER_WIDTH, '1'); ?></td>

<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td><h1><?php echo HEADING_TITLE; ?></h1></td>
		<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main"><?php echo TEXT_INFORMATION; ?></td>
	  </tr>
	  <?php if (EM_SHOW_MAP_LINES == 'true') { ?>
	   <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	   </tr>		  
	   <tr>
		<td class="main"><?php echo TEXT_DRIVING_INSTRUCTIONS; ?></td>
	   </tr>		  
	  <?php } ?>		 
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>

  <!-- Start map code //-->
  <tr>
   <td>
	<div id="map" style="width: 500px; height: 400px; border: .2em; border-style: ridge; "></div>
	<div id="message"></div>
   </td>
  </tr>

  <!-- BEGIN FORM -->
	<tr>
   <td align="right"><?php echo tep_draw_form('seotips', tep_href_link(FILENAME_EASYMAP, '', 'NONSSL'), 'post', 'onSubmit="return true;" onReset="return true"') . tep_draw_hidden_field('action', 'process'); ?></td>
  </tr>		  
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '20'); ?></td>
  </tr>
  <tr> 
   <td width="40%"><table border="1">
	<tr>
	 <th>Lattitude </th>
	 <th>Longitude </th>
	</tr>
	<tr> 
	 <td><?php echo tep_draw_input_field('lattitude', $lattitude, false); ?> </td>
	 <td><?php echo tep_draw_input_field('longitude', $longitude, false); ?> </td>
	</tr>
   </table></td>	 
  </tr>
  <tr> 
   <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '20'); ?></td>
  </tr>	  

  <tr>
   <td width="40%"><table border="0">   
	<tr>
	 <td width="45%"> </td>
	 <td><?php echo (tep_image_submit('button_update.gif', IMAGE_UPDATE) ) . ' <a href="' . tep_href_link(FILENAME_EASYMAP, '') .'">' . '</a>'; ?></td>
	</tr>
   </table></td>
  </tr> 
  <tr> 
   <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '20'); ?></td>
  </tr>	  
  </form>
	<!-- END FORM --> 
<!-- End Map code //-->

  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
</table></td>
	  <td class="columnRight"><?php echo tep_draw_separator('pixel_trans.gif', COLUMN_SPACER_WIDTH, '1'); ?></td>
  	 <td >  </td>
<!-- body_text_eof //-->
<td width="<?php echo COLUMN_RIGHT_WIDTH; ?>" valign="top"><table border="0" width="<?php echo COLUMN_RIGHT_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

and here is the link for what I am getting;

 

http://shopping.fhceramics.com/easymap.php

 

Any help or suggestions would be appreciated and thanks in advance

Link to comment
Share on other sites

  • 5 weeks later...

If you are using my version and it is not showing, it is almost definately the settings. Try turning them all off and see if anything shows up.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 1 month later...
Hmmm, I can´t seem to find the

var point = new GPoint(bounds.minX + width * <?php echo EM_LOCATION_X; ?>,
					 bounds.minY + height * <?php echo EM_LOCATION_Y; ?>);
  var marker = new GMarker(point);
  map.addOverlay(marker);

 

The newest contrib only has a "center marker" on the map, which u can delete or keep.

var marker = new GMarker(map.getCenter());
	map.addOverlay(marker);

so just add your locations like he said then! Im trying to hone it down if anyone can help and see @ SleeveKing.com MAP and why my borders are all askew?! thanks

Link to comment
Share on other sites

Sorry guys but I figured it out!!! So let me be the teacher now :lol: (this website helps customization like icons

 

1) Admin: True Markers / False Bubbles (this will take out the default bubble in the center)

2) Add this code as many times as you want and it even centers your map oOoOoOoOo

3) var html = ""; can be anything html really, Ive seen some cool designs with images and tabs so go at it, i hope you guys our Chicago baseball rivaly GO SOX!

 

function createMarker(point, name, address)
{var marker = new GMarker(point);
 var html = "<table><tr><td>City Sports<br>4601 N. Broadway St.<br>Chicago, IL 60640</td><td><img src=http://farm1.static.flickr.com/194/465430922_48e6436199.jpg border=0></td></tr></table>";
 GEvent.addListener(marker, "click", function()
	{marker.openInfoWindowHtml(html);});
 return marker;
}
var point = new GPoint(-87.624223, 41.889923);
var marker = createMarker(point);
map.addOverlay(marker);

function createMarker(point, name, address)
{var marker = new GMarker(point);
 var html = "<table><tr><td>XXX<br>123 N. Broadway St.<br>Chicago, IL 60640</td><td><img src=http://img.webring.com/r/c/chicagowhitesox/logo border=0></td></tr></table>";
 GEvent.addListener(marker, "click", function()
	{marker.openInfoWindowHtml(html);});
 return marker;
}
var point = new GPoint(-87.654223, 41.859923);
var marker = createMarker(point);
map.addOverlay(marker);

Link to comment
Share on other sites

  • 5 months later...

I just added this to my site...http://everestmusic.com/easymap.php

 

However I would like to add an additional locator to the map for my second store.

Does anyone know how I might go about doing this?

 

Thanks

Link to comment
Share on other sites

I just added this to my site...http://everestmusic.com/easymap.php

 

However I would like to add an additional locator to the map for my second store.

Does anyone know how I might go about doing this?

 

Thanks

Oh boy, you ask a major thing.

Couple ways (must know basic pogramming):

- Deal with easymap.php if you know some php and html

- Checkout http://code.google.com/apis/maps/documentation/examples/

(especially view page sources) and tune javascript codes in easymap.php

 

--

Serkan Hamarat

Link to comment
Share on other sites

Oh boy, you ask a major thing.

Couple ways (must know basic pogramming):

- Deal with easymap.php if you know some php and html

- Checkout http://code.google.com/apis/maps/documentation/examples/

(especially view page sources) and tune javascript codes in easymap.php

 

--

Serkan Hamarat

 

 

nope don't know basic programming.....

so i'm at the mercy of the nice people here who add contributions!

 

Guess I'll have to wait :(

 

I would have thought though that having multiple locations would be a fairly popular request.

 

Anyway thanks

Link to comment
Share on other sites

nope don't know basic programming.....

so i'm at the mercy of the nice people here who add contributions!

 

Guess I'll have to wait :(

 

I would have thought though that having multiple locations would be a fairly popular request.

 

Anyway thanks

Or you could read back through the thread to find the answer that was already posted for that problem.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Or you could read back through the thread to find the answer that was already posted for that problem.

 

Jack

 

Jack,

 

for EasyMap v2.4?

 

Maybe i'm blind, but i've read the entire thread twice and i'm not seeing it.

 

Aoife

Link to comment
Share on other sites

No, I was referring to my version, which is the only one I support. Others here have stated that the other versions don't work, but I can't say as I've never tried it.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi Aoife,

There is a function called map.addOverlay().

This function marks coordinates, and centers the map.

You just need a second mark on same map, right?

Code it manually, it's not so hard. Locate the second one like this:

1-Designate latitude and longitude from a map (google map for exact match).

2-Insert one definition and one function lines after the last map.addOverlay() line. (I guess, after line 176 in v2.4)

Finally you should see like this:

		points.sort(function(p1, p2) {
	  return p1.lng() - p2.lng();
	});
	map.addOverlay(new GPolyline(points));
	var point_two = new GLatLng(38.428883, 27.134449); // DEFINE NEW COORDINATES
	map.addOverlay(new GMarker(point_two));			// USE addOverlay() FUNCTION FOR MARKING THE SECOND POINT
	<?php } ?>
  }
}

Only two lines and that's it.

3-Tune zoom level from admin section, as enough to contains all your marks.

4-(optionaly) define chat bubble like how the coder did before.

 

Cheers

--

Serkan Hamarat

Link to comment
Share on other sites

  • 4 weeks later...

Hello,

 

I have installed the contribution but my map isn't showing, only a rectangular frame appears in that place.

Has someone a working version or a solution for my sepcific problem?

Link to comment
Share on other sites

I can only speak for the version I uploaded and it does work. If you are using it, then you've made a mistake in the installation.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I can only speak for the version I uploaded and it does work. If you are using it, then you've made a mistake in the installation.

 

Jack

 

I am currently using version 2.4! Version 1.1 from you works ok, but I don't want the longitude latutude to be displayed!

Link to comment
Share on other sites

Hello,

 

I have installed the contribution but my map isn't showing, only a rectangular frame appears in that place.

Has someone a working version or a solution for my sepcific problem?

 

If default direction lines removed and left empty, it might be a problem. You can completely disable this feature, if you want:

 

		// Add a polyline with five random points. Sort the points by
	// longitude so that the line does not intersect itself.
/*
	var points = [];

	  points.push(new GLatLng(southWest.lat() + latSpan * <?php echo $line[0]; ?>,
							  southWest.lng() + lngSpan * <?php echo $line[1]; ?>));
	  points.push(new GLatLng(southWest.lat() + latSpan * <?php echo $line[2]; ?>,
							  southWest.lng() + lngSpan * <?php echo $line[3]; ?>));
	  points.push(new GLatLng(southWest.lat() + latSpan * <?php echo $line[4]; ?>,
							  southWest.lng() + lngSpan * <?php echo $line[5]; ?>));
	  points.push(new GLatLng(southWest.lat() + latSpan * <?php echo $line[6]; ?>,
							  southWest.lng() + lngSpan * <?php echo $line[7]; ?>));
	  points.push(new GLatLng(southWest.lat() + latSpan * <?php echo $line[8]; ?>,
								 southWest.lng() + lngSpan * <?php echo $line[9]; ?>));

	points.sort(function(p1, p2) {
	  return p1.lng() - p2.lng();
	});
	map.addOverlay(new GPolyline(points));
*/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...