Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

EasyMap


Jack_mcs

Recommended Posts

This contribution adds a map to your shop via google's map API. The default settings show how lines can be drawn on the map to provide driving instrucitons. This would be limited to a local ara but may be useful to some people. It also has a Satellite display that is quite impressive.

 

I will upload it shortly so the support thread is included.

 

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

Here is the contribution, I forgot to mention that to use this, you will need to get an API key from google. It is a simple process and just takes a few minutes.

 

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

You can see samples here . I do my testing in FireFox so I didn't notice that this doesn't work in IE. It is because of a javascript problem in IE and there is a fix for it. I should have that uploaded today. So, to anyone who has downloaded it, please keep that in mind.

 

Jack

Edited by Jack_mcs

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

  • 3 weeks later...

Thanks for Easymap. It is working well except for a conflict with On the Fly Thumbnailer:

Division by Zero error in On the Fly Thumbnailer module at line 83 of html_outputp.php (see at the bottom of pasted code)

Any ideas on how to exclude Google maps from the thumbnailer process, or other possible fixes?

 

 

// "On the Fly Thumbnailer" using PHP GD Graphics Library by Nathan Welch (v1.5)

// Scales product images dynamically, resulting in smaller file sizes, and keeps

// proper image ratio. Used in conjunction with product_thumb.php t/n generator.

function tep_image($src, $alt = '', $width = '', $height = '', $params = '') {

 

// Set default image variable and code

$image = '<img src="' . $src . '"';

 

// Don't calculate if the image is set to a "%" width

if (strstr($width,'%') == false || strstr($height,'%') == false) {

$dont_calculate = 0;

} else {

$dont_calculate = 1;

}

 

// Do we calculate the image size?

if (CONFIG_CALCULATE_IMAGE_SIZE && !$dont_calculate) {

 

// Get the image's information

if ($image_size = @getimagesize($src)) {

 

$ratio = $image_size[1] / $image_size[0];

 

// Set the width and height to the proper ratio

if (!$width && $height) {

$ratio = $height / $image_size[1];

$width = intval($image_size[0] * $ratio);

} elseif ($width && !$height) {

$ratio = $width / $image_size[0];

$height = intval($image_size[1] * $ratio);

} elseif (!$width && !$height) {

$width = $image_size[0];

$height = $image_size[1];

}

 

// Scale the image if larger than the set width or height

if ($image_size[0] > $width || $image_size[1] > $height) {

[Line 83] $rx = $image_size[0] / $width;

Link to comment
Share on other sites

I don't use that contribution so I can't say for sure. You could try tessting to see if the page being displayed is the map page and if it is, just retrun from the function. I would have to look at the code to see what effect that would have. You would probably get a betteer answer by asking in the support thread for that contribution.

 

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 weeks later...

Google has a way of doing it but that method isn't included in the contribution. I will look into adding it at some point.

 

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...
Google has a way of doing it but that method isn't included in the contribution. I will look into adding it at some point.

 

Jack

 

 

Jack,

 

For some reason, STS kills the map. I have tried posting the java in an external file and requiring its inclusion in the easymap.php file, but STS is still keeping it from loading. I disable STS and it works.

 

Any ideas?

 

Thanks,

 

Nick

Link to comment
Share on other sites

What happens if you try to move the map? Does it switch to the proper location?

 

Jack,

 

 

When I move the map it doesn't switch to the proper location but remains with the default Palo Alto as if the new corrdinates did not take, howver when I take a look in admin the new lat & long are there and they also show up on the easpmap.php page. I am using the latest EasyMaps update release, perhpas I did something wrong or it is in conflict with another contribution I have installed.

 

On another note, is there an easy way to show maps & directions to two different locations?

 

Joe

Link to comment
Share on other sites

Jack,

When I move the map it doesn't switch to the proper location but remains with the default Palo Alto as if the new corrdinates did not take, howver when I take a look in admin the new lat & long are there and they also show up on the easpmap.php page. I am using the latest EasyMaps update release, perhpas I did something wrong or it is in conflict with another contribution I have installed.

 

On another note, is there an easy way to show maps & directions to two different locations?

 

Joe

The version I uploaded works. I haven't looked at the latest upload. Hopefully the person that did that will support 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

  • 1 month later...

Here's something for you hackers to figure out. For every customer in the database, I would like to add the latitude and longitude of their city and use Google Maps to show where all my customers are. I have sold all over the world on eBay (about 1500 customers) and want to map them on my soon-to-be osCommerce site. It would add legitimacy to the site.

Link to comment
Share on other sites

You would first have to edit your customers table to store their longitude and lattitude, or use some sort of look up code to find it. Then call in that information for the customer on the EasyMap page and use those coordinates instead of the ones from the database. So, yes, it is doable but the majority of code would have to do with coming up with the coordinates in the first place.

 

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

  • 4 weeks later...
You would first have to edit your customers table to store their longitude and lattitude, or use some sort of look up code to find it. Then call in that information for the customer on the EasyMap page and use those coordinates instead of the ones from the database. So, yes, it is doable but the majority of code would have to do with coming up with the coordinates in the first place.

 

Jack

 

Looks like I may be able to get the info online from the census bureau for each zip code.

Link to comment
Share on other sites

Does anyone have an example of a working osc website that has this contribution installed?
Please take a look at a few posts back.

 

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 Jack--so is the one pnkranger uploaded ok or is the last one you uploaded the one to use? I would rather use one I know works from the get go.

Edited by rabbitseffort

"I must admit that I personally measure success in terms of the contributions an individual makes to her or his fellow human beings."

---Margaret Mead---

 

"The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer.

--Ken Kesey"

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...