View Full Version : Addon: JBG Map v1.0 (Google Map addon)
jbulava
06-09-2006, 11:05 PM
JBG Map v1.0 (Google Map addon)
Download: jbgMap1.0.zip (http://www.jonbulava.com/projects/media/jbgMap1.0.zip)
Info and screen shots: http://www.jonbulava.com/projects/jbgmap.php
See the visitor side in use: http://photo.jonbulava.com/?x=jbgmap (My server is REALLY slow sometimes, just a heads up)
Description:
jbgMap is a robust Google Map addon that puts a great amount of control in your hands. Most importantly, it doesn't matter if your images have embedded GPS data or not.
It is a Pixelpost addon that allows the owner to give locations to their images regardless if you have GPS equipment or not. The addon was created with the casual photographer in mind, who may or may not know much about GPS.
The administration side allows the owner to navigate a Google Map and manually place a marker where each picture was taken. A later version will allow the owner to automatically use EXIF GPS tag data to skip this manual step or use it to 'tweak' a picture's position.
Once a photo has a location, it's ready to be shown on the main map that your viewers see.
Installation:
This is a two part installation (admin side and visitor side). As far as the files in the download are concerned, drop the 'admin_jbgMap.php' file into your 'addons' directory and place the two PNG images in your 'includes' directory. You will also need to get API keys from Google to use their maps, but that's all explained once you install the addon and read the manual. Follow the 'jbgMapManual.txt' file for a complete installation guide.
Bugs/Problems:
If you should find any bugs or problems with the addon, please let me know. I've had limited testing done waiting for others to upgrade to v1.5 of Pixelpost, but I've done exhaustive testing on every possible scenerio I could think of. Also, if you should have any ideas about how to make it better, please let me know as well!
Thanks, and enjoy.
Joe[y]
06-10-2006, 11:09 AM
yo. great work - just a shame it doesn't work for me:
receiving this error:
Settings not updated. One or more values were invalid.
i know the api keys i've got work and i know they're version 2 because i tested them on a html page and the maps were produced just fine. could this be to do with the hidden forms such as map coordinates and zoom depth?
PHP-version 4.4.0 (Pixelpost's min requirement: PHP version: 4.3.0 )
MySQL version 4.1.19-standard (Pixelpost's min requirement: MySQL: 3.23.58 )
raminia
06-10-2006, 01:42 PM
cool,
please add your addon to the addon list on wiki
http://wiki.pixelpost.org/index.php?title=Pixelpost_Addons
jbulava
06-10-2006, 06:21 PM
Joe[y],
This is an error that is displayed when validating the input for three things after 'Update Settings' is pressed: API version, Width and Height. I use the 'eregi' php function to make sure these three values are numeric. If the comparison fails, which would be on any non-numeric character being present or the field being left blank, then the message should show.
Make sure that your values are simply numbers. In other words, don't put 'px' in the boxes for width or height, just numbers. Check for spaces as well since they count as invalid characters.
I am running PHP-version 4.3.10 and MySQL version 4.1.12-log so I don't believe there is a problem there. The hidden maps and zoom levels should not be connected to this error message since they are hidden variables that do not need validation. The comparison used is shown below.
// Validate numeric input
$pattern = "^[0-9]+$";
if ( eregi($pattern,$apiVer) && eregi($pattern,$userWidth) && eregi($pattern,$userHeight) ) {
...table is updated...
else { ... show that error message ... }
Let me know if this works.
Connie
06-10-2006, 07:59 PM
this is a great step forwards, I am strongly interested in these possibilities
congratulation!
But please help me to find out:
is there a way to add this info to each photo instead of using one map as additonal page?
I would like to have features like this but in the last 12 months I was in
Russia, Armenia, Italia, Switzerland, Netherlands beside Germany...
how to get these photos to the map?
Joe[y]
06-11-2006, 10:41 AM
i understand that and i've checked for spaces and everything but i simply can't update the stuff via the addons page - i have to go into phpmyadmin and change stuff from there.
perhaps there is something small in the code which just isn't compatible with my php version etc. i wouldn't know where to start in spotting this though.
Joe[y]
06-11-2006, 10:44 AM
ok. quick point here.. god knows why it's producing querys like this but maybe you will know:
UPDATE `pixelpost_jbgMap` SET `user_width` = '700',
`user_height` = '500' WHERE `id` =1 AND CONVERT( `user_api_key` USING utf8 ) = 'ABQIAAA***********************j1ZLlPXh3-9w8d6NxQMh7pUuHXMwz4FwrCCjfKprnhmog' AND CONVERT( `admin_api_key` USING utf8 ) = 'ABQIAAAA_*****************eZ7zMgmoVRSpWfyr-ayDseFj2xckyIYVIH1Y6A' AND `api_ver` =2 AND CONVERT( `icon_type` USING utf8 ) = 'default' AND `map_type` =0 AND CONVERT( `info_thumb` USING utf8 ) = ' checked' AND CONVERT( `info_headline` USING utf8 ) = ' checked' AND CONVERT( `info_date` USING utf8 ) = ' checked' AND CONVERT( `info_time` USING utf8 ) = '' AND CONVERT( `info_categories` USING utf8 ) = '' AND `user_zoom` =3 AND CONVERT( `user_center` USING utf8 ) = '(39, -94.4)' AND `user_width` =800 AND `user_height` =532 AND `admin_zoom` =3 AND CONVERT( `admin_center` USING utf8 ) = '(39, -94.4)' LIMIT 1 ;
jbulava
06-12-2006, 03:42 AM
From this query, it seems like there may be a collation type issue. I know in newer versions of the phpmyadmin you can set/view the collation for each field. If you can, check to see what it is set for each in the jbgmap table. By default, I thought it was latin1 which should cover any characters needed, however, if your fields are utf8, then the query may be trying to convert the latin1 values to utf8 values to fit in the database.
If you would like to give something a try, edit line 59 in the admin_jbgMap.php file (this should be the end of the create table). We can try and force the database to use the latin1 charset/collation by replacing:
)";
with:
) DEFAULT CHARSET=latin1";
After that, drop the current jbgMap table and go back to the addon page in Pixelpost to create the table with this new line. Hopefully that should stop the convert function from being called and altering the values.
dorowski
06-12-2006, 06:01 PM
This is awesome, it works perfectly. Very easy to install, thanks :)
Joe[y]
06-12-2006, 06:08 PM
i'm gonna get in touch with my host. i had already tried your suggestion but that only changes the connection collation... what i need to change is the default character set for the whole database. right now it is utf-8 while all collation in all my tables etc is latin1... not good.
jbulava
06-12-2006, 06:57 PM
Connie, [and a note for everone]
Are you asking if there is a way to set image locations other than doing one at a time on the edit-image page? If so, I have not yet created a way to set multiple locations all at once.
If by chance you are asking about multiple maps for the visitors side, that is something coming in a future version. Different categories of pictures can be set to have their own center and zoom levels so your map does not have to be the entire earth if you have taken pictures in the US, Spain, and China.
If this doesn't answer your question, please let me know.
fabrizio
06-16-2006, 09:46 PM
hi J. you have made an excellent work!!
the system is very very intersesting...
we will wait for with much attention the future releases...
I was moreover trying to understand if, and like it, were possible to make a direct link from the page of the single photo to the bookmark on the map?
thanks for all
fabrizio
fotografieinrete (http://fotografieinrete.ciannamea.it)
jbulava
06-16-2006, 10:47 PM
ah! Good catch, fabrizio. A link to the map that would automatically display that image's info window is at the top of my list. This was a feature I decided to hold back on so I could release v1.0 without delaying it any longer. Don't worry, this will be a new tag for version 1.1!
blinking8s
06-16-2006, 11:41 PM
this is bad ass, nice addon...
DerPatrick
06-17-2006, 12:14 AM
I have a problem with JBG Map - it only work in Admin, not on the Frontside.
But have a look yourself:
http://fotoblog.1n8.de/index.php?x=jbgmap
I have copied the sample code from google to a sample page and it works, but do not show the correct area, it had to show europe/germany/rees but show Palo Alto (Don't know where exactly it is, but seems very far away from here)here is the link to the sample page:
http://fotoblog.1n8.de/map.html
If you can have a look at the sourcecode of the page you see the api key is the same.
On admin page i see both maps and all works correct, on frontpage nothing works.
What is wrong?
UPDATE:
Sorry, i'm sooo damn stupid - I only have to RTFM - no no no.
Now it works perfecty!
Thank you Jon for this great Addon.
UPDATE2:
Now I have a new problem, the popups in the Map have white text on white ground!
:cry:
UPDATE3:
OK... OK... RTFM again :x
Now really all works perfect !
:smile:
Kind regards,
Patrick
jbulava
06-17-2006, 04:32 PM
hahaha, I'm glad that all worked out. Yes, when in doubt, RTFM. :rolleyes:
TheRedRose
06-18-2006, 04:41 PM
Hello there,
I made a quick modification to show a specific image using
// show image or just the map?
if (($_GET['showimage'] != "") && ($_GET['showimage'] == $data->id))
{
// yes, center map on image
$jbgmap_tpl .= "viewMap.setCenter(new GLatLng{$data->jbgmap}, 15);";
}
Just paste the code after this line in admin_jbgMap.php
// Add marker to map
$jbgmap_tpl .= "viewMap.addOverlay(createMarker(new GLatLng{$data->jbgmap}, \"{$pic_thumb}\", \"{$pic_headline}\", \"{$pic_date}\", \"{$pic_time}\", \"{$pic_categories}\"));";
So easy ;)
Only problem is the fixed zoom level but it works well for me.
Have a look at it:
center map on image id 162 (http://jedentageinbild.de/index.php?x=jbgmap&showimage=162)
show whole map
(http://jedentageinbild.de/index.php?x=jbgmap)
greetings
Sebastian
JedenTagEinBild.de (http://www.JedenTagEinBild.de)
jbulava
06-18-2006, 05:59 PM
This method actually works out quite nice because not only did I want to center the map around the given image, but also have the infoWindow pop up automatically. This can be done by combining the addOverlay line and the if loop as seen below. Keep in mind that I just wrote this really quick and did not even test it to see if it works...it's just the kind of functionality I'd like to see work! Once it is tested, it will be a part of the next version. Also, instead of the fixed zoom of '15,' I used the zoom setting from the admin side. Again, this code would be replacing the 'add marker to map' line of code in version 1.0, not adding to it.
// Add markers, displaying infoWindow if picture is specified
if (($_GET['showimage'] != "") && ($_GET['showimage'] == $data->id)) {
// Create marker, add to map, change center, and display infoWindow
$jbgmap_tpl .= "
var tempMarker = createMarker(new GLatLng{$data->jbgmap}, \"{$pic_thumb}\", \"{$pic_headline}\", \"{$pic_date}\", \"{$pic_time}\", \"{$pic_categories}\");
viewMap.addOverlay(tempMarker);
viewMap.setCenter(new GLatLng{$data->jbgmap}, {$view_Zoom});
tempMarker.openInfoWindowHtml("<div id='jbgInfoWindow'>{$pic_thumb}<span id='jbgHeadline'><br />{$pic_headline}</span>{$pic_date}{$pic_time}{$pic_categories}</div>");
";
}
else {
$jbgmap_tpl .= "
viewMap.addOverlay(createMarker(new GLatLng{$data->jbgmap}, \"{$pic_thumb}\", \"{$pic_headline}\", \"{$pic_date}\", \"{$pic_time}\", \"{$pic_categories}\"));";
}
Thanks for the feedback, keep it coming!
TheRedRose
06-18-2006, 06:27 PM
Works, except for a little change I had to make:
tempMarker.openInfoWindowHtml(\"<div id='jbgInfoWindow'>{$pic_thumb}<span id='jbgHeadline'><br />{$pic_headline}</span>{$pic_date}{$pic_time}{$pic_categories}</div>\");
I changed both ["] to [\"]. I think the PHP formating of your post removed the \.
Great work by the way, I love this addon and have been looking for something like that for some time.
OldAbe
06-21-2006, 01:06 PM
I got the same problem as Joe[y]. "Settings not updated. One or more values were invalid." Is that problem solved or does it remain?
fabrizio
06-22-2006, 07:29 AM
Hi Jon,
another suggestion forn the new release,
a direct link to Google Earth directly form the "info window" on the map...
ike this
http://www.digitalpoint.com/tools/geovisitors/?do=earth&coord=144.9667,-37.8167
What do you think?
Have a nice day
fabrizio
inophoto
06-22-2006, 10:46 PM
I too get the error: "Settings not updated. One or more values were invalid."
MySQL Administrator confirms that the table collation is set to 'latin1'. Anything else I can try?
jbulava
06-23-2006, 02:19 PM
The issue with my error message: "Settings not updated. One or more values were invalid" has not been solved yet. Since I cannot replicate the problem at home, it is somewhat difficult to fix.
However, I have a quick suggestion for those that have no problem editing the php code for testing. Since this (what I thought was) simple validation is causing things not to work, try commenting out two pieces starting on line 84:
if ( eregi($pattern,$apiVer) && eregi($pattern,$userWidth) && eregi($pattern,$userHeight) ) {
and
}
else {
$alertMsg = "<font style='color:#ff0000;font-weight:bold;'>Settings not updated. One or more values were invalid.</font><p />\n";
}
If anyone can comment these parts out to eliminate the validation check, please let me know what the results are (i.e., If the values are stored and diplayed correctly).
inophoto
06-23-2006, 02:51 PM
Hi Jon,
No joy i'm afraid. Obviously the error message dissapeared but the api keys are still not stored. It doesn't create the extra inputs in the image edit tab either.
CREATE TABLE `pixelpost_jbgmap` (
`id` int(1) NOT NULL default '0',
`user_api_key` varchar(100) NOT NULL default '',
`admin_api_key` varchar(100) NOT NULL default '',
`api_ver` int(3) NOT NULL default '2',
`icon_type` varchar(10) NOT NULL default 'default',
`map_type` int(1) NOT NULL default '0',
`info_thumb` enum(' checked','') NOT NULL default ' checked',
`info_headline` enum(' checked','') NOT NULL default ' checked',
`info_date` enum(' checked','') NOT NULL default ' checked',
`info_time` enum(' checked','') NOT NULL default '',
`info_categories` enum(' checked','') NOT NULL default '',
`user_zoom` int(2) NOT NULL default '3',
`user_center` varchar(50) NOT NULL default '(39, -94.4)',
`user_width` int(5) NOT NULL default '800',
`user_height` int(5) NOT NULL default '532',
`admin_zoom` int(2) NOT NULL default '3',
`admin_center` varchar(50) NOT NULL default '(39, -94.4)'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
OldAbe
06-23-2006, 03:38 PM
I get the same as inophoto now, api keys not stored.
/OA
jbulava
06-23-2006, 04:14 PM
So the version number and pixel width/height are being stored, just not the API keys?
Ok, let's try an idiot check here on my part...I was always assuming that API keys were of a fixed length (86 chars) so the size I allocated in the table was 100 characters. Please let me know if your API key lengths are longer than this.
inophoto
06-23-2006, 04:43 PM
Hi Jon,
My API keys are 86 chars. Additionally, I ran a small check and changed some of the variables (image height, width etc). These changes are not passed on back to the database - so i'm not sure that it's an issue primarily with the api keys,
costanza
06-23-2006, 08:45 PM
I think this is quite possibly the coolest thing I've seen in PixelPost so far. I'm wondering how I can achieve something like TheRedRose had going... a link under each picture that would take you to the map view with the marker for that particular picture.
For instance, I take most of my photos in Baton Rouge, Louisiana, but some others in other states... if the normal user map is centered on BR, they would really have to already know where the other ones are to find them on the map.
Can anyone offer specific guidance so I can do that? Thanks!
jbulava
06-24-2006, 08:27 PM
costanza,
I may have mentioned this somewhere else, but not sure, so I'll repeat it. The next version of this addon will have an otional tag that, if used, will display a dropdown menu (unless someone else has a better interface idea) of predefined or saved locations. That way, you can focus in on different areas. For example, you will have a default zoom and center, but clicking on / selecting a different location will zoom the map out, change the center, and then zoom back in to the new location of images.
Update: Instead of the optional dropdown menu, I've decided to try and create a custom GControl that is displayed within the map itself. Hopefully it won't be too difficult to get working...
costanza
06-26-2006, 02:58 PM
ahh ok. its great already, so whatever new stuff you got coming will be gravy. Thanks!
inophoto
06-27-2006, 12:22 PM
I got it working!
To anyone that was having the 'settings not updated' problem I have found a temporary workaround until Jon can fix it. It's not ideal, or pretty but it works.
The trick is to edit the 'admin_jbgMap.php' file and manually add the api keys and any other settings (line 41-59). The killer problem with this method is that the admin panel still doesn't work - so you can't change your values without dropping the table and loosing your image location information. So.. get your settings as you like them, then go and update your images.
Hope that was clear enough. I'm still giddily overjoyed :)
Joe[y]
06-27-2006, 12:37 PM
I got it working!
To anyone that was having the 'settings not updated' problem I have found a temporary workaround until Jon can fix it. It's not ideal, or pretty but it works.
The trick is to edit the 'admin_jbgMap.php' file and manually add the api keys and any other settings (line 41-59). The killer problem with this method is that the admin panel still doesn't work - so you can't change your values without dropping the table and loosing your image location information. So.. get your settings as you like them, then go and update your images.
Hope that was clear enough. I'm still giddily overjoyed :)
i had already found i could edit the details manually myself directly in my database with phpmyadmin - which is probably a safer way to change things. still need a fix for this problem though and i can't see one...
inophoto
06-27-2006, 12:57 PM
Strange.. if I manually edit the database fields they don't seem to update. Must just be my setup.
Anyway, at least there are a couple of methods.
I'm trying to add the additional code to center on a specific image but i'm struggling to get it working. All good fun :)
Ignore that.. Works fine.
jbulava
06-27-2006, 03:11 PM
Still working on this problem, but I just don't understand where it's coming from. I'll probably have to pass it over to some of my more skilled MySQL friends...once I find some. If anyone out there has some that can take some time to look at it as well, that would be appreciated.
A quick note for inophoto, when dropping the jbgMap table, you will only lose settings. The actual image locations are stored in a column that was added onto your main pixelpost table with all the other image data.
inophoto
06-27-2006, 08:06 PM
Yeah. Sussed that out now. Very neat :)
It should be easy enough for anyone to get it working with the info in this thread anyway. It's a great plugin.
Thanks
fabrizio
07-18-2006, 01:51 PM
Hi,
what is the way to link the single photo to the zoomed map from the image's page of pixelpost? like the "location link" of INO's web site...
thanks to all for cooperation
fabrizio
The instructions for adding single-image links are earlier in the forum thread. Unfortunately, I wasn't able to get either version to work. Kept getting "unexpected T_STRING" errors and for the life of me I couldn't figure out where it was coming from. Any word on when we can expect a new version? Anyone have any troubleshooting tips for the previously posted single image link solutions?
timorous
08-04-2006, 04:19 PM
Unfortunately, I was not able to get this addon working, even after trying some of the suggestions in this thread. Will a new version be coming out soon that will, for example, address the issue of the API keys not updating in the addon admin panel? Thanks.
jbulava
08-06-2006, 02:58 AM
Wow, it's been awhile since I've been here. Sorry! I've been busy getting ready for graduate school and moving. HOWEVER, expect the next version to be released most likely before the end of the month.
Code for the single image to map is included in the new version. It consists of the discussion between me and TheRedRose on an early page. The new features are exciting and hopefully the API keys issue will be fixed...I still cannot replicate it for testing. I doubt this is the issue, but if someone who has the problem can send me a list of what other add-ons they are using, I would like to see if a conflict of form values lies there. Thanks.
Florid
08-07-2006, 01:24 AM
Install this addon on my site (http://photoblogonline.com/index.php?x=jbgmap) and adding pictures on map ... look's like Works...
DerPatrick
08-08-2006, 07:57 AM
Install this addon on my site and adding pictures on map ... look's like Works...
Your problem is that you have more Ads than photos on your site - but i think you know that.
I think you are only posting here to make money with the ads on your site.
http://forum.pixelpost.org/images/icons/icon13.gif
Hello,
It's a very interresting addon.
I Have a problem when displaying the map, no image and text appears when I click on the point : an example here : http://supergenials.free.fr/egotrip/index.php?x=jbgmap
Could someone help me ?
Thank you in advance ...
Florid
08-08-2006, 08:43 PM
2DerPatrick
- Photos much more than Ads. Maybe Ads helps me to pay a hosting In the future. It upsets you?
- With site and my traffic on it big money don't make
- I posting here because i like it. You wrong :-(
- I make money offline not online and It is much more than using Ads
DerPatrick
08-09-2006, 07:41 AM
- I posting here because i like it. You wrong :-(
I'm sorry when I'm wrong - but i dont like so much Ad on a website.
Sorry and happy posting
DerPatrick
08-09-2006, 07:52 AM
Hello,
It's a very interresting addon.
I Have a problem when displaying the map, no image and text appears when I click on the point : an example here : http://supergenials.free.fr/egotrip/index.php?x=jbgmap
Could someone help me ?
Thank you in advance ...
@Eric
Dont know if it solve the problem, but this is not correct:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
This two tags are double, you should delete one of it
Thank you DerPatrick; I deleted one of the two duplicate ...
But the problem is still here grrrr !
Now, we can read the title of each picture.
The problem is the same when I try to replace google mark by thumbnail, this one does not appear ...
Eric
DerPatrick
08-09-2006, 09:13 AM
Thank you DerPatrick; I deleted one of the two duplicate ...
But the problem is still here grrrr !
Now, we can read the title of each picture.
The problem is the same when I try to replace google mark by thumbnail, this one does not appear ...
Eric
The script try to load the thumb from http://supergenials.free.fr/thumbnails/ instead from http://supergenials.free.fr/egotrip/thumbnails/
Have you enter on Google Maps API Key registration the right path to your photoblog and admin? (with /egotrip/)?
Yes, I've just verified this point, the two right keys are generated ...
DerPatrick
08-09-2006, 12:16 PM
Sorry Eric, but I dont know why the script dont use the right path.
Check the manual for the jbgmap and check your code/settings - something must be go wrong!
:confused:
Now, it runs ... I have done some changing in the code of admin_jbgMap.php file, in order to have good path (for ex. thumbnails/file.jpg instead of ../thumbnails/file.jpg).
But I still don't now why it was a bug on my site ...
DerPatrick, thank you for your help ...
Eric
Hi , I live in Paris and I've just installed your addon.
Works wonderfully !!
My site is mainly about the beauties of my home city; see by yourself:
http://pthevenin.free.fr/index.php?x=jbgmap
Cheers.
taquinade
08-20-2006, 12:31 AM
Hello every <body>,
Sorry for my english, i'm french.
I'm looking for a answer:
i search to make a link beetwen a picture and a map, like on your web site Jon ("View on map").
Thank you
Taquinade
jbulava
08-20-2006, 02:43 AM
This is something that is implemented in the next version. I am using an unfinished v1.1 on my site to test this out. When the new version is released (hopefully later in the month) you can use the <JBG_PICTOMAP> tag which will create a link to the map with the image id number (the showimage variable). The new map page will then display an infoWindow popup if the showimage id number is provided in this link. Again, this will be in the new version. If you want to try it manually yourself, there should be earlier posts pertaining to the issue.
taquinade
08-20-2006, 08:33 AM
Hello,
it's all right, i have modify the addons file to get the picture ID and zoom the Google API to the right area.
Bye
taquinade
08-21-2006, 08:30 AM
Hy,
This is my website with the addon:
http://thierrypigot.free.fr/
Bye,
Taquinade
taquinade
08-22-2006, 07:44 AM
Hi,
here is a mod to have a display list with de picture "headline" in the "admin/pictures/JBGOOGLEMAP" menu:
http://img225.imageshack.us/img225/321/modne8.th.jpg (http://img225.imageshack.us/my.php?image=modne8.jpg)
With this mod you can change the picture without to go back in the "admin/picture" menu
Just change "JBGMap_admin_addon()" function by this one:
/************************************************** **********
* Function to be displayed as sub-menu on edit-image page
************************************************** **********/
function JBGMap_admin_addon() {
// user defined globals
global $pixelpost_db_prefix;
if(empty($_POST['pict_choix'])){
$id = $_GET['id'];
}else{
$id = $_POST['pict_choix'];
}
$updateMsg = "";
// Update the current image coordinates
if( $_POST['imageUpdate'] == 'Update Image' ) {
$imagePoint = $_POST['imagePoint'];
$query = "UPDATE {$pixelpost_db_prefix}pixelpost SET jbgmap = '$imagePoint' WHERE id = '$id' LIMIT 1";
mysql_query($query) or die( mysql_error() );
echo "<font style='color:#ff0000;font-weight:bold;'>Map coordinates updated successfully.</font><p />\n";
}
// Apply EXIF data for coordinates
if( $_POST['imageUpdate'] == 'Use EXIF Tags' ) {
echo "<font style='color:#ff0000;font-weight:bold;'>EXIF GPS tag functionality is not available in version 1.0.</font><p />\n";
}
// Get image data ---------
$query = "SELECT id, headline, image, jbgmap FROM {$pixelpost_db_prefix}pixelpost WHERE id ='$id'";
$result = mysql_query($query) or die(mysql_error());
if( $imageData = mysql_fetch_object($result) ) {
$imageID = $imageData->id;
$imageTitle = $imageData->headline;
$imageFile = $imageData->image;
$imagePoint = $imageData->jbgmap;
}
else {
echo "No image found for specified id number.";
}
// Get map settings ----------
$query = "SELECT admin_api_key, api_ver, admin_zoom, admin_center FROM {$pixelpost_db_prefix}jbgMap LIMIT 1";
$result = mysql_query($query) or die( mysql_error() );
if ( $mapData = mysql_fetch_object($result) ) {
$adminApiKey = $mapData->admin_api_key;
$apiVer = $mapData->api_ver;
$adminZoom = $mapData->admin_zoom;
$adminCenter = $mapData->admin_center;
}
// Set default coordinates if necessary
$pointExists = true;
if ($imagePoint == '') {
$imagePoint = $adminCenter;
$pointExists = false;
}
// Liste des images
$list_query = mysql_query("SELECT id, headline FROM {$pixelpost_db_prefix}pixelpost ORDER BY id ASC");
while ($res_list = mysql_fetch_array($list_query)) {
if($res_list['id'] == $id){$chk=" selected";}else{$chk="";}
$option .= "\t<option value=\"{$res_list['id']}\"$chk>".stripslashes($res_list['headline'])."</option>\n";
}
$form = "<form method='post' action=''>\n";
$form .= "<label for=\"pict_choix\">Map coordinates for: </label>\n";
$form .= "<select name=\"pict_choix\" onChange=\"this.form.submit();\">\n";
$form .= $option;
$form .= "</select>\n";
$form .= "</form><br />\n";
// Start display
echo "<p>$form</p><img src='../thumbnails/thumb_$imageFile' /><p />\n";
// Display map code and link
echo "
<script src=\"http://maps.google.com/maps?file=api&v={$apiVer}&key={$adminApiKey}\"
type=\"text/javascript\"></script>
<script type=\"text/javascript\">
//<![CDATA[
function loadEditMap() {
if (GBrowserIsCompatible()) {
var editMap = new GMap2(document.getElementById(\"editMap\"));
editMap.addControl(new GSmallMapControl());
editMap.addControl(new GMapTypeControl());
editMap.setCenter(new GLatLng{$imagePoint}, {$adminZoom});";
if ($pointExists) {
echo "editMap.addOverlay(new GMarker(new GLatLng{$imagePoint}));";
}
echo "// Click event
GEvent.addListener(editMap, \"click\",
function(marker, point) {
if (marker) {
editMap.removeOverlay(marker);
document.getElementById(\"imagePoint\").value = \"\";
}else{
editMap.clearOverlays();
editMap.addOverlay(new GMarker(point));
document.getElementById(\"imagePoint\").value = point.toString();
}
}
);
}else{
document.getElementById(\"editMap\").innerHTML = \"Google Maps is not compatible with this browser.\";
}
}
//]]>
</script>
<i>Automatic</i> (Not yet implemented)<br />
If your image contains EXIF positioning tags, the Google Map coordinates can be set automatically by clicking the 'Use EXIF Tags' button below. You may also use the map to adjust points, for example, if multiple pictures were taken at the same location.<p />
<i>Manual</i><br />
Use the interactive map below to set an image's coordinates yourself.<br />
» Click on the map to set where the image was taken.<br />
» Clicking on a new location will change the origin of the picture.<br />
» Clicking the marker itself will clear the coordinates and will then not show up on the user's map view.<br /><br />
<a href=\"javascript:void(0);\" title=\"Click to load this image's map.\" onClick=\"loadEditMap()\">Click to load this image's map</a>
<p /><div id=\"editMap\" style=\"width: 400px; height: 266px;border:1px solid #000000;\" ></div>
<br />
<form method='post' action='index.php?view=images&imagesview=jbgooglemap&id=$imageID'>
<input type='hidden' name='imagePoint' id='imagePoint' value='$imagePoint'>
<input type='hidden' name='pointExists' id='pointExists' value='$pointExists'>
<input type='submit' name='imageUpdate' value='Use EXIF Tags'><p />
<input type='submit' name='imageUpdate' value='Update Image'> <input type='button' name='Cancel' value='Cancel' onclick=\"javascript:document.location='index.php?view=image s';\">
</form>";
}
;-)
bye,
Taquinade
jaybussiere
09-04-2006, 11:36 PM
Darn.
Settings not updated. One or more values were invalid.
I tried to add in the googlemap codes into the php page but that didn't change anything really.
jbulava
09-10-2006, 04:08 AM
arg! Sorry everyone, grad school has been keeping me WAY busy being full time. Hopefully this upcoming weekend I'll have time to concentrate on this more. I'm going to go through every suggestion and comment once again to have a checklist of features/mods/additions ready to go. Thanks for your patience. Any ideas you want me to throw on, just let me know!
Connie
09-10-2006, 08:13 AM
I am still curious about this and I have many places (Hamburg, Moscow, Yerevan..... ) so I will appreciate your AddOn for sure!
Derryonline
09-11-2006, 04:10 PM
arg! Sorry everyone, grad school has been keeping me WAY busy being full time. Hopefully this upcoming weekend I'll have time to concentrate on this more. I'm going to go through every suggestion and comment once again to have a checklist of features/mods/additions ready to go. Thanks for your patience. Any ideas you want me to throw on, just let me know!
I'd just like to say that even though it took a bit of fiddling and updating table rows manually in PHPMyAdmin, this is the greatest addon I've ever used, excellent work.
boffers
09-14-2006, 10:09 PM
Just a quite note: two thumbs up! I just installed the addon on my fotoblog and I got some very nice comments. This is really awesome. Keep up the good work!
tried to install the addon. it shows up in the admin panel and I can click on the map. but when working in the image editing mode to set the location on the map I can't save it. Also all links (only when I'm working on the jbg-map-page) on the admin panel don't work (example: can't click on "categories" when setting map coordiantes). The url-string looks right but I get a 403 and 404!
why?
boffers
09-18-2006, 01:40 PM
Please take a look at this website with some nice extra functionalities: http://www.score.nl/cgi-bin/ScoreOnlineStore.storefront/450e9fec008e1761271dd5d381d406dc/UserTemplate/google_maps
I am wondering if the addon can be extended with these features:
- Generate a KML file for Google Earth program
- When you select a store, you can click on the option "Klik hier om in te zoomen" (Click here to zoom in)- it would be great if this can also be added!
- When you click the zoom link, a small overview is also loaded at the bottom right corner. Awesome!
Im next happy user of this addon.
If someone is interested about location in Poland, Warsaw then here is an example:
http://blog.piotrgalas.com/map/
taquinade
09-19-2006, 10:17 AM
...
- When you click the zoom link, a small overview is also loaded at the bottom right corner. Awesome!
something like this:
http://thierrypigot.free.fr/index.php?x=jbgmap
In next release I would go forward and and few things which have flickr:
http://www.flickr.com/map/
I.e. images grouping with navigation within group.
boffers
09-19-2006, 09:04 PM
something like this:
http://thierrypigot.free.fr/index.php?x=jbgmap
Correct! Do you know how he did this? I couldn't find an e-mail address on his website..
Do you know how he did this?
By installing and using this addon :)
taquinade
09-20-2006, 08:33 AM
By installing and using this addon :)
Not really, it's my website. I have change the code to include somme new function.
To do this, change the end code:
$jbgmap_tpl .= "
}else{
document.getElementById(\"viewMap\").innerHTML = \"Google Maps is not compatible with this browser.\";
}
}
//]]>
</script>";
By
$jbgmap_tpl .= "
// ======== Add a map overview ==========
viewMap.addControl(new GOverviewMapControl(new GSize(200,150)));
// ======== A function to adjust the positioning of the overview ========
function positionOverview(x,y) {
var omap=document.getElementById(\"map_overview\");
omap.style.left = x+\"px\";
omap.style.top = y+\"px\";
// == restyling ==
omap.firstChild.style.border = \"1px solid gray\";
omap.firstChild.firstChild.style.left=\"2px\";
omap.firstChild.firstChild.style.top=\"2px\";
omap.firstChild.firstChild.style.width=\"190px\";
omap.firstChild.firstChild.style.height=\"190px\";
}
// ======== Cause the overview to be positioned AFTER IE sets its initial position ========
setTimeout(\"positionOverview(558,254)\",1);
}else{
document.getElementById(\"viewMap\").innerHTML = \"Google Maps is not compatible with this browser.\";
}
}
//]]>
</script>";
;)
Now, i'm working on the, external dynamique source (XML parsing), "group picture" fonction, center and automatic zooming, google earth link (kml generator), ...
boffers
09-20-2006, 09:51 AM
That is fantastisch taquinade.
I will test it later this day, hopefully you are also willing to share the new functionallity you are mentioning you are currently developing. Good luck!
The link which you gave to boffers was a standard version of addon.
Its good to know that you want develop it and add my sugestions (and this from other users) :)
PS In next release I would make map in admin panel bigger. Why on front is so big and admin must work on so small to find the place where he/she took picture??
Dennis
09-20-2006, 06:08 PM
I've tried the add-on today. I guessed we were still on version 2 of the api's so I left that number unchanged.
However my api-keys are not valid and I'm sure I entered the website right. Not sure what I've done wrong..
[edit]
I entered all values by hand and did some reading. Suspect it has to do with an utf8 to latin1 conversion or vice versa.
It works, but I'm unable to update through the interface.
Clavain
09-21-2006, 08:37 AM
Great Addon, it works fine on my pixelpost testsite http://photos.fuzzilein.net
but how can i add this "View on Map" link under each photo?
Dennis
09-21-2006, 10:46 AM
Great Addon, it works fine on my pixelpost testsite http://photos.fuzzilein.net
but how can i add this "View on Map" link under each photo?
I suspect this will be in version 1.1
* New tag: JBG_PICTOMAP
This tag will be used on your image template. It will be a link to the
jbgmap template file with the photo's id as a passed value. If
coordinates exist for this image, the info window will pop up
automatically.
This evening I'll try to examine the reason why some people get errors in their update process in the admin section, perhaps I can help the original author with this.
------------------------------ FOUND IT!!!! --------------------
After examining the code I discovered the "error". I believe the author does his coding with the PHP REGISTER_GLOBALS setting on on. However, I use REGISTER_GLOBALS on OFF.
When using a variable from a form in the old days you could use $formvariable, but when the globals are off you should use $_POST['formvariable'] to make things work.
So I entered the following code right after:
if( isset( $_POST['jbgMapUpdate'] ) ) {
// Validate numeric input
$pattern = "^[0-9]+$";
// With register globals off you will need this!!!
$userZoom=$_POST['userZoom'];
$userCenter=$_POST['userCenter'];
$adminZoom=$_POST['adminZoom'];
$adminCenter=$_POST['adminCenter'];
$userApiKey=$_POST['userApiKey'];
$adminApiKey=$_POST['adminApiKey'];
$apiVer=$_POST['apiVer'];
$userWidth=$_POST['userWidth'];
$userHeight=$_POST['userHeight'];
$infoThumb=$_POST['infoThumb'];
$infoHeadline=$_POST['infoHeadline'];
$infoDate=$_POST['infoDate'];
$infoTime=$_POST['infoTime'];
$infoCat=$_POST['infoCat'];
And then continue with the if ( eregi statements.
Clavain
09-21-2006, 11:42 AM
I suspect this will be in version 1.1
* New tag: JBG_PICTOMAP
This tag will be used on your image template. It will be a link to the
jbgmap template file with the photo's id as a passed value. If
coordinates exist for this image, the info window will pop up
automatically.
is the version 1.1 available yet???
Dennis
09-21-2006, 12:02 PM
is the version 1.1 available yet???
Nope, it's working as a beta on the author's site atm
jbulava
09-21-2006, 02:07 PM
Great work!! I will put this into the new version and make sure it still for myself and hopefully I'll get feedback from others who have had the problem. Thanks again for helping! I'll post the next version after a few more tests.
Dennis
09-21-2006, 02:33 PM
Wel please note this is a quick and dirty fix. $_POST['formvariable'] will always work, regardless of the setting of REGISTER_GLOBALS
So you yust might wanna change all variables to this format instead of making new ones. (e.g. the SQL query, the selected/on settings, the EREGI expression.)
I must admit I'm rather lazy so I did it like this to get a quick test.
Another thing I would like to see is het size of the admin map in the db. It doesn't require a lot of code, since user Height and Width is already used. I changed it manually in your code atm, but I'm looking for a more longterm solution to the problem.
Also send you an e-mail for testing the current release and perhaps give some feedback before releasing it.
And by the way: I love the Google addon :)
inophoto
09-22-2006, 09:12 AM
Nice to see that this addon is still being worked on. As one of the people who was experiencing problems before, I would be happy to beta-test the new version. Mind, I have changed hosts now so the problem may have dissapeared anyway.
Dennis
09-22-2006, 12:51 PM
Ok, I was wondering how this addon will deal with multiple pictures on one location. Will this cause multiple markers, or can multiple photo's be connected to one single marker?
inophoto
09-22-2006, 05:07 PM
You would have to have multiple markers.
IMHO it can handle multiple images for one marker. It isnt hard to do.
When you are at addon section you should be able to choose new marker on map or attache current image to existing one (on map). Thats all.
Dennis
09-25-2006, 12:05 PM
IMHO it can handle multiple images for one marker. It isnt hard to do.
When you are at addon section you should be able to choose new marker on map or attache current image to existing one (on map). Thats all.
Nope it can't. The default is one marker, one image. Performed extensive tests, was unable to conclude otherwise.
Dennis
10-04-2006, 02:08 PM
Ow man, I have a load of improvements and enhancements to discuss with jbulava but somehow he won't respond to my mail, direct messages and stuff.
I feel I could really help him making this addon even better, but since he also made improvements already it would be foolish to incorperate the enhancements in an old version.
polanri
10-07-2006, 09:43 AM
Damn.. long time without posts in this topic, is this addon still developed?
I just installed and it's really great, but I'm missing the "view on map" option :(
Hi J,
Thanks for the add on. It's great!
y
Dennis
10-07-2006, 08:36 PM
Damn.. long time without posts in this topic, is this addon still developed?
Yup, but the author hasn't been around atm.
I just installed and it's really great, but I'm missing the "view on map" option :(
That feature is present in the new release 1.1, but I'm still waiting for the author to release this version.
I've hacked this feature in the old 1.0 version.
polanri
10-08-2006, 08:52 AM
Yup, but the author hasn't been around atm.
Damn! I hope he's ok :/
That feature is present in the new release 1.1, but I'm still waiting for the author to release this version.
Yes, I've seen it working on his web site and it's cool
I've hacked this feature in the old 1.0 version.
Is it easy to to do? Can you explain it here? It might be a solution for me and others waiting for vers. 1.1 :)
Dennis
10-08-2006, 09:32 AM
Is it easy to to do? Can you explain it here? It might be a solution for me and others waiting for vers. 1.1 :)
Yeah it is. I'm currently implementing some other features also. Send me a mail or dm for more info.
fabrizio
10-11-2006, 04:37 PM
hi to all
why from when I have updated pixelpost to version 1.5 it not visualizes the thumbnais in the map page of my blog?
http://fotografieinrete.ciannamea.it/blog/index.php?x=jbgmap
thanks for yours suggestions.
fabrizio
Dennis
10-11-2006, 05:53 PM
hi to all
why from when I have updated pixelpost to version 1.5 it not visualizes the thumbnais in the map page of my blog?
http://fotografieinrete.ciannamea.it/blog/index.php?x=jbgmap
thanks for yours suggestions.
fabrizio
Hi, the thumbnails are located in the source. I'm not sure why they don't display. If I copy/paste the link I see the thumbnail.
I also see 3 errors and 5 warnings on your site. Perhaps you can clear these first and it will fix the bug with the thumbnails.
I too use version 1.5 and have no problems with the addon.
Perhaps re-saving the settings might help to.
Clavain
10-13-2006, 01:00 PM
hi to all
why from when I have updated pixelpost to version 1.5 it not visualizes the thumbnais in the map page of my blog?
http://fotografieinrete.ciannamea.it/blog/index.php?x=jbgmap
thanks for yours suggestions.
fabrizio
hello, i had the same problem, open the admin_jbgMap.php and search
for "../thumbnails" there is the problem you have to change it to "./thumbnails" (there are more the one "../")upload the changed file to your webserver and you will be happy.
the background is, your photoblog is under a subdirectory called "blog", the same with me, but the addon looks for the thumbnails directory in the root directory.
greetings
Dennis
10-13-2006, 03:57 PM
Great catch, Clavain!
Well done, hadn't figured that one out yet. Perhaps PP should have something like a basefolder or something like that. It will minimize these problems.
Clavain
10-13-2006, 05:45 PM
Great catch, Clavain!
Well done, hadn't figured that one out yet. Perhaps PP should have something like a basefolder or something like that. It will minimize these problems.
Oh yeah, as i said, i had the same problem at the beginning.
Dennis
10-13-2006, 06:03 PM
Oh yeah, as i said, i had the same problem at the beginning.
You should try my update (which has the same flaw nevertheless) :D
Clavain
10-13-2006, 06:19 PM
You should try my update (which has the same flaw nevertheless) :D
you had sent my the beta version, i made the changes and it works for me
:D
Dennis
10-13-2006, 08:50 PM
you had sent my the beta version, i made the changes and it works for me
:D
You should try the update: i made some adjustments after that :D
fabrizio
10-17-2006, 04:21 PM
thanks Clavain
excellent discovery!!
Dennis
10-19-2006, 12:06 PM
I made a new version of the addon, based on the suggestions made by Stuart and Me! in this forum.
New features include:
* Locations of previous images can be seen when editting the location of an image (as requested on the forum)
* Added a new option: Zoomlevel when showing the location of the picture. This enables a flexible zoomlevel.
* Added language file support
* Bigger map in the admin section
* Bug fix: the map is now automatically loaded when searching for an address
I've updated the manual written by Jon to reflect the changes and I added all the original files needed by this addon.
You can download it here (http://home.casema.nl/mooibroek/pp/admin_jbgMap.zip).
Please note I've opened a new thread (http://forum.pixelpost.org/showthread.php?t=5304) and moved posts regarding this new version made by me from this thread to the new one.
Please post comments/remarks/questions regarding my version in the new thread and save this thread for the original version made by Jon.
Nathalie
11-11-2006, 02:12 PM
Thank you for this great addon.
I added the following link in the image teplate:
<a href="index.php?x=jbgmap&showimage=<IMAGE_ID>" title="View this place on Google map" >View on map</a>
But when I click on the displayed link, the Google map does not display the thumbnail of the selected picture.
The tag <JBGMAP_LINK> gives the same.
When looking at John Bulava web site, the google map is loaded with the thumbnail of the selected picture:
http://photo.jonbulava.com/index.php?x=jbgmap&showimage=40
What is wrong on my side?
Thanks,
Nathalie
As you can see Dennis - when blog is at root dir sometimes there is problem with paths - just like at my place (../ instead of / at the beginning of thumbnail paths). Same issue as at my case.
Nathalie
11-11-2006, 06:13 PM
Anything I can do?
For me thumbs at your site and at mine works fine but paths isnt 100% correct (but that isnt problem right now).
Only problem is that there is no "clouds" at your site, i.e.:
http://www.manypixels.eu/index.php?x=jbgmap&showimage=639
Nathalie
11-11-2006, 06:27 PM
Indeed yes, there is one. But I don't know why the page does not zoom to the location.
If you zoom progressively around paris (where you see the marker), you will see another places where there are markers, a little more in the north: la defense.
Any idea, why the map does not automatically zoom to the appropriate marker as I can see on your site?
Thanks,
Nathalie
Nathalie
11-11-2006, 06:55 PM
All is working fine with the 1.5 release I just saw from Schonhose...
Nathalie
jbulava
11-11-2006, 08:51 PM
Nathalie,
It is in the next version, but I have not had time to work on it unfortunately because of graduate school. However, you can modify version 1.0 to get what you want. Take a look at the link below. This code needs to be in the file for the link to an image to work correctly.
http://forum.pixelpost.org/showpost.php?p=32103&postcount=18
Also, you need to use the <JBGLINKTOMAP> tag (code below) which needs to be in the tag replacements section. Or you can make up your own tag replacement. Add these elements, and it should work!
// Link to map with image, <JBG_PICTOMAP>
$tpl = ereg_replace("<JBG_PICTOMAP>","<a href=\"index.php?x=jbgmap&showimage=" . $image_id . "\" title=\"View this image on a map\">View on map</a>",$tpl);
I hope that helps! If you have any questions, let me know.
jbulava
11-11-2006, 08:54 PM
To everyone,
Once again I apologize for having to drop my project for so long. My plans in graduate school have taken most of my time. When this semester is over, I will be using a good amount of time to add many new features and hopefully coordinate with those users who have been so compelled to continue its development in my absence. I'm glad to see how widespread the project has become!
~Jon
Dennis
11-13-2006, 05:58 AM
Jon, I picked up where you left and added some exciting features and some bugfixes. Have a look at it: http://forum.pixelpost.org/showthread.php?t=5304
Perhaps we can join forces on this one. (I mailed you about it a couple of times)
Dennis
11-13-2006, 06:02 AM
As you can see Dennis - when blog is at root dir sometimes there is problem with paths - just like at my place (../ instead of / at the beginning of thumbnail paths). Same issue as at my case.
All is working fine with the 1.5 release I just saw from Schonhose...
Nathalie
You were saying? :D
And please remember: discuss my updated version here: http://forum.pixelpost.org/showthread.php?t=5304
Cameron Hopkins
12-27-2006, 01:15 AM
Hey all
This add-on is working great so far except that I am not able to GeoCode any places in the UK (such as London or "London UK") for example. Has anybody come across the same problem?
Cam
jbulava
12-27-2006, 01:38 AM
Cameron,
Could you be more specific? Are you running the original version of the addon, or someone else's version? I've been away and haven't had a chance to look at other versions of JBG Map, but I know the original doesn't have any textual input for Geocoding, only clicking on the map.
Cameron Hopkins
12-27-2006, 04:26 AM
Cameron,
Could you be more specific? Are you running the original version of the addon, or someone else's version? I've been away and haven't had a chance to look at other versions of JBG Map, but I know the original doesn't have any textual input for Geocoding, only clicking on the map.
Hi Jon
Thanks for your response. My query relates to difficulty in marking any places in the UK. Does marking London or Oxford etc work for you? I am wondering whether it is a Google-related issue rather than anything regarding your add-on.
I hope that helps.
Cam
Dennis
12-27-2006, 11:18 AM
Hi Cameron, the version you're using is a new version. This question is not related to the version by Jon.
Nevertheless I will answer your question, because it is related to my version (see this thread (http://forum.pixelpost.org/showthread.php?t=5304)).
Geocoding UK or China
All attempts to use the Google Maps API geocoder on addresses in the UK or China currently fail with code 603 (G_GEO_UNAVAILABLE_ADDRESS) indicating that legal or contractual reasons prevent Google from returning the information.
The Maps API geocoder provides detailed geocoding for Andorra, Australia, Canada, France, Germany, Italy, Japan (but only in Japanese), Netherlands, New Zealand, Spain, and United States of America (e.g. "4144 Avenue Pierre-De-Coubertin, Montréal, Canada"). For countries other than the UK and China it provides geocoding for country names and city names (e.g. "Nairobi, Kenya").
The Google AJAX Search API will return the coordinates of cities in the UK and China and will geocode UK post codes. See Official Blog: How to add Google Search to your Maps API application
API Geocoding for Japan was announced on 7 Dec 2006 in the Official Blog. Street address queries are only supported in Japanese.
So I'm sorry, but geocoding isn't supported for the UK at the moment.
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.