View previous topic :: View next topic |
Author |
Message |
fahiemoto Smarty n00b
Joined: 18 Nov 2008 Posts: 4
|
Posted: Tue Nov 18, 2008 9:48 am Post subject: GoogleMapAPI:createMarkerIcon: Error reading image |
|
|
I have a problem showing a custom icon in the GoogleMap API.
i get the error message:GoogleMapAPI:createMarkerIcon: Error reading image: logo.png.
i did the following: i added the following line in the file:
$map->setMarkerIcon('logo.png','logo.png',0,0,10,10);
I anyone can explain to me how to intergrate a custom icon i would be realy happy!
this is the file:
<?php
require('GoogleMap/GoogleMapAPI.class.php');
$map = new GoogleMapAPI('map');
// setup database for geocode caching
$map->setDSN('mysql://*****:******@localhost/*****');
// enter YOUR Google Map Key
$map->setAPIKey('YOURGOOGLEMAPKEY');
// create some map markers
$map->addMarkerByAddress('koningstraat 277 den haag','Fahiemoto','<b>Fahiemoto</b>');
$map->addMarkerByAddress('koningstraat 300 den haag','Raies','<b>Raies</b>');
$map->addMarkerByAddress('Koningin Wilhelminaplein 1 den haag','<b>Showroom</b>');
$map->addMarkerByAddress('Rijswijkseweg 622 den haag',"Hoofdkantoor","<b>Hoofdkantoor</b>");
$map->setMarkerIcon('logo.png','logo.png',0,0,10,10);
?>
Last edited by fahiemoto on Thu Nov 20, 2008 11:08 pm; edited 1 time in total |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Nov 18, 2008 3:43 pm Post subject: |
|
|
Use the full path to the icon, relative to doc root. Start with a slash /. See the example in the docs. |
|
Back to top |
|
Syruis Smarty Rookie
Joined: 09 Dec 2008 Posts: 7
|
Posted: Tue Dec 23, 2008 2:56 pm Post subject: |
|
|
Same problem but with full path:
GoogleMapAPI:createMarkerIcon: Error reading image: [..]
( i can post URL)
I'm not solo...(Type this error in google)
thanks in advance, |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Dec 23, 2008 4:43 pm Post subject: |
|
|
Does $_SERVER['DOCUMENT_ROOT'] have a value in your PHP script? It relies on that to be set to your doc root to find the image. |
|
Back to top |
|
Syruis Smarty Rookie
Joined: 09 Dec 2008 Posts: 7
|
Posted: Wed Dec 24, 2008 8:42 am Post subject: |
|
|
Yes something like:
/data/www/[...] |
|
Back to top |
|
Syruis Smarty Rookie
Joined: 09 Dec 2008 Posts: 7
|
|
Back to top |
|
Syruis Smarty Rookie
Joined: 09 Dec 2008 Posts: 7
|
Posted: Wed Dec 24, 2008 2:22 pm Post subject: |
|
|
yes... |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Dec 24, 2008 2:25 pm Post subject: |
|
|
My guess is that getimagesize() does not like a URL path. Try using a local system filepath (relative to doc root.) |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Dec 24, 2008 2:26 pm Post subject: |
|
|
Try using /vin/gmap/Bonsplans.png as the filepath. |
|
Back to top |
|
Syruis Smarty Rookie
Joined: 09 Dec 2008 Posts: 7
|
Posted: Wed Dec 24, 2008 2:44 pm Post subject: |
|
|
Hello,
i have tested with a locale path and it works fine, but it will be nice if it works with "http" localisation ( and https )... |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Dec 24, 2008 5:59 pm Post subject: |
|
|
getimagesize() does not like URLs. Use the same path as you would use inside an <img src=""> tag. It is that way on purpose so you don't need to think about system paths. I suppose it could internally chop off the host, but I think using the relative path in the first place is a better choice.
Last edited by mohrt on Thu Dec 25, 2008 3:24 pm; edited 1 time in total |
|
Back to top |
|
Syruis Smarty Rookie
Joined: 09 Dec 2008 Posts: 7
|
Posted: Wed Dec 24, 2008 6:32 pm Post subject: |
|
|
Ok... |
|
Back to top |
|
|