Forum
Welcome, Guest
  • Page:
  • 1

TOPIC: GoogleMapApi.class.php document root

GoogleMapApi.class.php document root 3 years, 3 months ago #81

Hi,

Thanks for this component.

I'm running on a local server, using wamp.
Joomla 1.5
sobi 2.9.0.2


so directory is

localhost:85/test1.

It's complaining about

GoogleMapAPI:createMarkerIcon: Error reading image: /components/com_sobi2/GoogleMapsIcons/icong1.png

echoing document root

D:/Program Files/wamp/www/

But my site is in

D:/Program Files/wamp/www/test1.

What's the best to overcome this, without hardcoding?

cheers
Ed

Re:GoogleMapApi.class.php document root 3 years, 3 months ago #82

  • jerry
  • OFFLINE
  • Moderator
  • Posts: 407
I never installed it on a localhost. Let me look into it a little bit and I'll get back with you shortly.

jerry

Re:GoogleMapApi.class.php document root 3 years, 3 months ago #83

  • jerry
  • OFFLINE
  • Moderator
  • Posts: 407
Try changing the folowing lines:
 
$MapMarkerIcon = '/components/com_sobi2/GoogleMapsIcons/icong'.$iconNum.'.png';
$MapMarkerShadow = '/components/com_sobi2/GoogleMapsIcons/shadow50.png';
 
 

To:
 
$MapMarkerIcon = 'GoogleMapsIcons/icong'.$iconNum.'.png';
$MapMarkerShadow = 'GoogleMapsIcons/shadow50.png';
 
 


This should make the link document relative instead of root relative. p.s. You may need a / at the start of the literal, so try both.

Jerry

Re:GoogleMapApi.class.php document root 3 years, 3 months ago #84

Hi Jerry,

thanks for the reply.

Doing the above, I get the following error.

GoogleMapAPI:createMarkerIcon: Error reading image: GoogleMapsIcons/icong1.png

I think the path should be changed in GoogleMapApi.class.php

$_shadow_image_path = strpos($iconShadowImage,'http') === 0 ? $iconShadowImage : $_SERVER['DOCUMENT_ROOT'] . $iconShadowImage; 


should include something in addition to DOCUMENT_ROOT.

But not sure which file to include?

I think I need access to

JURI::base()

but I don't know which file to include?

cheers
Ed


where

            $_shadow_image_path = strpos($iconShadowImage,'http') === 0 ? $iconShadowImage : $_SERVER['DOCUMENT_ROOT'] . $iconShadowImage;

Re:GoogleMapApi.class.php document root 3 years, 3 months ago #85

  • jerry
  • OFFLINE
  • Moderator
  • Posts: 407
Actually, it would work to put "/test1" in front of the links where they are referenced. When you go into production you won't have that extra layer and you could remove them. A pain, I know. The API is a package that I downloaded. I included it in my zip for convenience. I think with the few places you would have to change, it would be better just to prepend the reference to test1, but it is up to you.

Jerry
  • Page:
  • 1
Moderators: jasper, nicholas, henry, jerry
Time to create page: 0.98 seconds

Login