Google Maps + Gallery

swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Fri, 2006-01-13 04:05

Using 0.4.8c I'm not able to use the "person" markers. I can select them on the Admin panel but after clicking save it just reverts to my previous marker used (bigdots). I even tried creating a new set and named it "people" but the same thing happens.
Map still displays fine but seems like bigdots is hardcoded to it.
Anyone else see the same?

EDIT: Err, never mind. I misinterpreted how these function on the admin panel.
All is fine.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Fri, 2006-01-13 04:32
swordfish wrote:
EDIT: Err, never mind. I misinterpreted how these function on the admin panel.
All is fine.

Not quite ... I was thinking the same. it's too confusing and it happens to me as well. I'm gonna think of something to make it more friendly :)

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Fri, 2006-01-13 04:37
Termitenshort wrote:
It has to be a messed up item, can you tell me what's in the DB (mapMap table) for itemId = 16 ?

Also what is itemId = 16 ? can you view the item with /main.php?g2_view=core.ShowItem&g2_itemId=16

Pardon me Termite; but, I think you mistake array number 16
for itemId 16. :-) You had me going there for a minute when the action to look at the Id through Gallery produced an
album . . .and the only album I had applied the PG theme (to
see what PG was about) to at that.

There is no itemId 16 in mapMap. I agree that there is some
phantom item running aroung in there; but, to track it down
and kill it . . . mmmmm . . . this is the difficulty. Please
don't spend any more of your precious development time on
this. I'll eventually figure it out and let you know my
findings.

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Fri, 2006-01-13 04:39
swordfish wrote:
Cool! I like the g3 templates.

Good. Thank You.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Fri, 2006-01-13 04:41
galmoid wrote:
Quote:
It has to be a messed up item, can you tell me what's in the DB (mapMap table) for itemId = 16 ?

Also what is itemId = 16 ? can you view the item with /main.php?g2_view=core.ShowItem&g2_itemId=16

Pardon me Termite; but, I think you mistake array number 16
for itemId 16. :-) You had me going there for a minute when the action to look at the Id through Gallery produced an
album . . .and the only album I had applied the PG theme (to
see what PG was about) to at that.

There is no itemId 16 in mapMap. I agree that there is some
phantom item running aroung in there; but, to track it down
and kill it . . . mmmmm . . . this is the difficulty. Please
don't spend any more of your precious development time on
this. I'll eventually figure it out and let you know my
findings.

Well then ok :). I'll be on my way to bed where I will dream of the module building itself while I sleep :)

Hmm .. er.. I mean I'm just gonna sleep and then code some other day :)

See you
------------------------
The Termite :)

 
mchapman2

Joined: 2006-01-11
Posts: 20
Posted: Fri, 2006-01-13 13:38

Termite,

I cannot create routes or filters. Also, when I edit a photo, I get an error attempting to use the "get via address" button to enter GPS co-ordinates. I have to delete the photo and re-upload it. I can use the "get via map" to put the co-ordinates in.

Mike

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Fri, 2006-01-13 13:57
mchapman2 wrote:
Termite,

I cannot create routes or filters. Also, when I edit a photo, I get an error attempting to use the "get via address" button to enter GPS co-ordinates. I have to delete the photo and re-upload it. I can use the "get via map" to put the co-ordinates in.

Mike

I see that ... do you have MSN messenger to chat, I'd like to get to the bottom of that ?

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Fri, 2006-01-13 14:03
Termitenshort wrote:
do you have MSN messenger to chat

If you don't maybe you can give me access to change files on the server directly

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Fri, 2006-01-13 14:04

Mike

Actually before all that, can you upgrade you install to version 0.4.8c+ the ShowMap.tpl above ? You are using (b) right now.
-------------------------
The Termite :-)

 
mchapman2

Joined: 2006-01-11
Posts: 20
Posted: Fri, 2006-01-13 14:46

My MSN handle is

. What's yours? Also, I am in a place where I cannot ftp to my server, if you like I'll give you the logins to it and let you do it. Only if you want to. If not, it will be later tonight or this weekend before I'll be able to do that.

Mike

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Fri, 2006-01-13 15:10

Hello all,

we're going to need some voting again ... I have downloaded gallery from CVS and try to use the google map module and oh ! surprise, it's completly broken ...

The all thing is due to Core API v 7.0 and Module API v 3.0 (as opposed to v6 and v2) currently in use. Those are not compatible with each other and also require a bunch of changes ...

So the deal is which one to use ? VOTE HERE ....

-------------------------
The Termite :-)

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2006-01-13 15:38

This is just my opinion:
Since Gallery 2.1 will be out in Feb some time (after some RC stages) a new map module will be needed.

I think we should keep fix the bugs in this release ( c or d ) and call that the final version of the map module to work with G2.0.

Once that is complete we should work on G2.1 to work with Google map API V2.

I don't think we should develop 2 version concurrent as this will just confuse the users.

In my opinion the module with its feature set now is VERY good. If people are wanting new features then they should be willing to upgrade the module/map api/ Gallery ( all 2 at the same time )

So in summery:
1.only fix bugs in version 0.4.8c and halt development (IMO it is good)
2. develop 0.5 with googlemap api V2 and Gallery V2.1

Does that make sense?

____________________________________________________
Gallery Frames / Mods || G1 Test Gallery

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Fri, 2006-01-13 16:16
floridave wrote:
So in summery:
1.only fix bugs in version 0.4.8c and halt development (IMO it is good)
2. develop 0.5 with googlemap api V2 and Gallery V2.1

I second the motion.
I hope voting for 'We change everything for v7/v3 now' correctly
reflects this second.

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Fri, 2006-01-13 16:21

Termite,
If there ends up being a 0.4.8d, maybe you'd consider sticking the
'g3' templates into it? In case you have not looked at them, they
have the 'Get Directions' in them (without the 'value added' links
of the 'g2' templates).

Keep thinking on the 'Get Directions to next Location' for routes
idea. :-)

 
djrm2
djrm2's picture

Joined: 2005-10-04
Posts: 54
Posted: Fri, 2006-01-13 17:54

Greetings everyone, and thankyou developers for the excellent work on the map module.

My system:
Gallery2 2.01
Map Module 0.4.8c
Exif module 0.1.0
Also: GPS theme 0.1.0
Firefox 1.5

I have patched the 1.0.0 exif module to understand the location tags and it is working nicely with the old map theme.
I have some photos with exif location data included, the details exif locations show properly on my album pages.
I am trying without success to make the feature to copy exif location data from a photo into the location field.

Am I right in thinking that there should be a button on "Edit Photo" "Google Map" to use the exif data?
I get the warning message "Exif is older than version 1.0.1 ..."
Nevertheless I think there should be a button to copy the exif data, is this the case?

Unfortunateley I do not understand the structure of the module to investigate for myself what is happening.
Could one of you developers please explain the conditions neccessary to make the exif feature work?
Could anyone suggest any testing to help me make it work.
I have tried without success to find the updated (0.1.1) exif module, does anybody know how to update it?

Regards Dave.

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Fri, 2006-01-13 18:48
djrm2 wrote:
Greetings everyone, and thankyou developers for the excellent work on the map module.
I have tried without success to find the updated (0.1.1) exif module, does anybody know how to update it?

Here is my patched exif module. I zipped it such that it will
unzip into a drectory named 'exif_module_orig_PlusGPS_sjk1.0.1'.
You will need to mv your existing exif module aside (up one
directory level) and create a new modules/exif directory into
which you would place the contents of the directroy mentioned
above. I use this and it works fine with no 'older than' warning and successfully imports coordinates from geocoded
pics. Also adds the GPS stuff under 'Extra Data/ EXIF/IPTC Settings'
in Site Admin.
The Edit Photo of Google Map should look like the one in the
attached pic.

If you attempt to use this and it or you break your system,
don't blame me. :-)

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Fri, 2006-01-13 19:20
galmoid wrote:
Termite,
If there ends up being a 0.4.8d, maybe you'd consider sticking the
'g3' templates into it? In case you have not looked at them, they
have the 'Get Directions' in them (without the 'value added' links
of the 'g2' templates).

Keep thinking on the 'Get Directions to next Location' for routes
idea. :-)

yes there will be a (d) and yes there will be the "g3" templates in them :)

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Fri, 2006-01-13 19:24
floridave wrote:
Does that make sense?

Yep sounds good :-)

I'm still gonna clean the code (-> v 0.4.9) because this module will be the base to develop the next release and cleaner it will be easier to upgrade :)

See you !

 
djrm2
djrm2's picture

Joined: 2005-10-04
Posts: 54
Posted: Fri, 2006-01-13 19:31
galmoid wrote:
Here is my patched exif module.

Thankyou galmoid that has worked for me and I can now transfer gps locatio from exif to map module.

fyi, I had to remove my old exif module first because the upgrade would not work on my V1.0.0 version. but the re-install worked fine.

edit: The following may help others upgrading the exif module.
I had manually edited the database to change the item oldexifversion from 1 to 0 before performing the exif re-install (this did not enable the exif button), I expect that this action would always be needed to avoid the warning message. The exif button now appears and works now weather oldexifversion is now set to 0 or 1. hth Dave

Dave.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Fri, 2006-01-13 19:34

Ok, so al the polls are closed and hre are the final choices:

- Do we use the Google API v2 ?
YES, but it will be in version 0.5.0 which will be designed to work with gallery 2.1

- Do we put this project into a Sourceforge.net area ?
YES, I will make sure it's all current soon (like tonight or this week-end) and then we can discontinue using this thread and point people to the Sourceforge are where we can have multiple dev, keep track of bugs, have a "ticketing system" for bugs, etc ....
====> I will need some help If anyone would like to volonteer :):):):)

- What of the module version ?
*Current Module will be made version 0.4.9 (cleaned-up 0.4.8) and it will be final release for Gallery v 2.0
* Next release is 0.5.0 with google Api v2, function with Gallery 2.1 (only) and the dev continues !!

Hope everyone aggrees to that. If not, you are welcome to protest heavily :)

See you all soon :)!

-------------------------
The Termite :-)

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Fri, 2006-01-13 19:36
galmoid wrote:
I second the motion.
I hope voting for 'We change everything for v7/v3 now' correctly
reflects this second.

no it doesn't but I fixed it for you with a new option :)

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Fri, 2006-01-13 19:39
djrm2 wrote:
Thankyou galmoid that has worked for me and I can now transfer gps locatio from exif to map module.

Maybe we should include galmoid's patched version of EXIF Module included in the final release of the module for Gallery 2.0 in case someone does not want to upgrade so they can take advantage of all the features ?

Just a stupid thought tho ...

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Fri, 2006-01-13 20:34
Termitenshort wrote:
no it doesn't but I fixed it for you with a new option :)

Do I need to cast the vote again . . . or is it, at this point
irrelevant?

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Fri, 2006-01-13 20:36
Termitenshort wrote:
Maybe we should include galmoid's patched version of EXIF Module included in the final release of the module for Gallery 2.0 in case someone does not want to upgrade so they can take advantage of all the features ?

Just a stupid thought tho ...

Stupid only if you just do it without making sure I have done
nothing lame in what I did. :-)

 
djrm2
djrm2's picture

Joined: 2005-10-04
Posts: 54
Posted: Fri, 2006-01-13 20:39

I have both the gps module (0.1.0) and the map module (0.4.8c) installed.
The album action "Export to GE" only works properly in the GPS module.
In the map module it fails and generates a file containing just the following:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
<Folder>
<name>test</name><br />
<b>Fatal error</b>: Call to undefined function: curl_init() in <b>/usr/share/gallery2/modules/map/GoogleEarthAlbum.inc</b> on line <b>113</b><br />

Dave

edit:
If I comment out lines 109 to 120 (see below) in GoogleEarthAlbum.inc then the problem goes away.
I cant tell what those lines are supposed to be there for, does anone know?

#$u='http://pingomatic.com/ping/?title=' . urlencode($child->getTitle()) .
#'&blogurl=' . urlencode(str_replace('&amp;', '&', $urlGenerator->generateUrl (array (
# 'view' => 'core.ShowItem', 'itemId' => $child->getId()), false))) .
# '&chk_geourl=on&chk_a2b=on';
# $ch = curl_init ($u);
#
# $devnull = fopen ('/dev/null', 'w');
# curl_setopt ($ch, CURLOPT_FILE, $devnull);
# curl_exec ($ch);
#
# curl_close ($ch);
# fclose ($devnull);

System is Debian, Apache2, php4.3, Gallery2
phpinfo shows just this one reference to curl:'--with-curl=shared,/usr'
but I'm none the wiser yet :-( and just what is pingomatic anyway?

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Fri, 2006-01-13 20:48

Regarding my problems with the new Group feature. I have isolated the
section of ShowMap.inc where things go funny (where I suspect the extra
blank entry is being created).

//The following line causes the group marker not to show up unless commented
//                            if ($point['regroupShowHigh'] >= $z) $pointHash[$id]['regroupShowHigh'] = $z-1;
//The following line cause cntpointHash to go from 7 to 8
//                            $pointHash[$point['parentId']]['hasHiddenChild'] = true;

Everything above the mentioned code showed that the count($pointHash) was 7
and then in this code it tripped out and went to 8.

In commenting the lines I got the map to work -and- the group marker to show
up (and operate). Should the tooltip on the marker say anything other than
the group name? When I click the marker I get an infowindow. If I click the
Zoom In link in the infowindow I get a new map with just the items defined in
the group.

Now, why does the above code cause me these problems? Too much for my
pea brain. :-)

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2006-01-14 01:46
djrm2 wrote:
I have both the gps module (0.1.0) and the map module (0.4.8c) installed.
The album action "Export to GE" only works properly in the GPS module.
In the map module it fails and generates a file containing just the following:

The GPS module integrated in the Map Module is a later version (0.2.0) and I know there was some mention of that geourl deal (which I dunno what it does:))

curl needs a library called libcurl to function and basically allow connection to a webpage and gather the output from it. I'm sure there is other way to do that with the built-in function of PHP (which is a better practice) but to be perfectly honnest I never got to test that feature. I only integrated it :)

Before this can be changed, we would need to know what exact;y is done, maybe contacting the author (nicroets) might get you some additional help ?

Maybe someday i'll get a gps tracking device ...

Let us know if you find anything else.

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Sat, 2006-01-14 02:26
Termitenshort wrote:
The GPS module integrated in the Map Module is a later version (0.2.0) and I know there was some mention of that geourl deal (which I dunno what it does:))

After having a quick look, I think geourl is a site to register
your gallery item or album at associating it with a coordinate.

From the GeoURL site:

GeoURL is a location-to-URL reverse directory. This will allow you to find URLs by their proximity to a given location. Find your neighbor's blog, perhaps, or the web page of the restaurants near you. GeoURL is listing 233,724 sites.

If djrm2 can run the old version of the GPS module and it
makes calls to curl I would expect having the library is not
the problem. I have no idea where to get the old version
of that module to do any comparison; but, would imagine some
path or include needs to be realized in the new module.

In the end, I would guess that commenting the lines mentioned
would only impact registering at GeoURL. Ithat does not
matter and it works . . . move along. :-)

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2006-01-14 02:32
galmoid wrote:
Now, why does the above code cause me these problems? Too much for my
pea brain. :-)

Well I think this pointed me in the right direction, can you try the following enclosed file and let me know ?

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2006-01-14 02:35
galmoid wrote:
Quote:
The GPS module integrated in the Map Module is a later version (0.2.0) and I know there was some mention of that geourl deal (which I dunno what it does:))

After having a quick look, I think geourl is a site to register
your gallery item or album at associating it with a coordinate.

From the GeoURL site:

GeoURL is a location-to-URL reverse directory. This will allow you to find URLs by their proximity to a given location. Find your neighbor's blog, perhaps, or the web page of the restaurants near you. GeoURL is listing 233,724 sites.

If djrm2 can run the old version of the GPS module and it
makes calls to curl I would expect having the library is not
the problem.

I'm pretty sure the old version wasn't doing any curl. it got added afterward when the geourl deal got added (if I remember correctly)

galmoid wrote:
In the end, I would guess that commenting the lines mentioned
would only impact registering at GeoURL. Ithat does not
matter and it works . . . move along. :-)

True :)

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Sat, 2006-01-14 02:43
Termitenshort wrote:
Well I think this pointed me in the right direction, can you try the following enclosed file and let me know ?

Good job. Was it specific to me or ???

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2006-01-14 02:48
galmoid wrote:
Quote:
Well I think this pointed me in the right direction, can you try the following enclosed file and let me know ?

Good job. Was it specific to me or ???

Nope it was just for everyone. The Group markers that gets created basically were missing 3 properties that was preventing the regrouping to work right. If Marker Regroup is disable, no problem oterwise ....

Along the way I also found another bug that I just corrected.

When you have map size = 100% + marker regroup enable and a group. It would happen at time that the regroup marker show even thought it should not.

I'm gonna release 0.4.8d tomorrow sometime.

Thanks a lot for investigating. It cut down the research time for me by a lot :):):)

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Sat, 2006-01-14 03:50
Termitenshort wrote:
galmoid wrote:
Quote:
Thanks a lot for investigating. It cut down the research time for me by a lot :):):)

Glad my efforts bore fruit. Sorry for being, uncharacteristically,
lazy in the beginning. :-)

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Sat, 2006-01-14 04:13

For your reading pleasure . . .

Regarding Version 2 of the API

and don't miss . . .

Mike Williams' Google Maps API Version 2 Tutorial

 
djrm2
djrm2's picture

Joined: 2005-10-04
Posts: 54
Posted: Sat, 2006-01-14 08:48
djrm2 wrote:
I have both the gps module (0.1.0) and the map module (0.4.8c) installed.
The album action "Export to GE" only works properly in the GPS module.
In the map module it fails and generates a file containing just the following:

The export to Google Earth feature actually attempts to do three things:
1) generate file main.kml to download / import into Google Earth
2) ping geourl with the album (I think)
3) set the picture coordinates

The locations are derived by searching the gps tracklog for timestamps matching with the exif origination timestamps of the photos.

All I want to use the export to GE feature for is to automatically add the coordinates from my gps log to my photos, I do not need to ping the geourl site so this is of no concern to me.

I decided what lines to remove by comparing the code between the old gps module and the map module, the lines I commented out only appeared in the map module. The reference to curl in the commented out section is the only reference to curl in the whole of gallery2 - so I guess curl does not work on my system, and probably on many others too.

If the feature could be re-written in a more portable way then I suggest that it should be. Alternativeley an otion to enable the various parts would be good. Removing the broken bit completely as I have shown is better for me than leaving it as it was.

Regards, Dave.

 
djrm2
djrm2's picture

Joined: 2005-10-04
Posts: 54
Posted: Sat, 2006-01-14 09:28

When using the get via a map feature of edit album to fill the coordinates there is an error saving the coordinates from time to time. This appears to be due to the very large number of digits after the decimal point.

For example here are two locations, the first is as obtained from the get via a map feature the second has the last digit of the lattitude removed. the first is impossible to save, the second is ok.

-1.6533136367797852, 54.22683320135782
-1.653313636779785, 54.22683320135782

hth Dave.

 
djrm2
djrm2's picture

Joined: 2005-10-04
Posts: 54
Posted: Sat, 2006-01-14 10:13
djrm2 wrote:
If you are trying to use the 'Get via a Map link' feature in a limited area then a quick edit of gallery2/modules/map/template/GPSMap.tpl allows the initial map to be localised to suit your needs.
I put these values in for an itial map of the whole of the UK.

{* line 14 <div id="map" class="gbBlock" style="width: 400px; height: 300px; color:black;"> djrm *}
<div id="map" class="gbBlock" style="width: 600px; height: 600px; color:black;">

{* line 22 map.centerAndZoom(new GPoint(-12,20),16); djrm *}
map.centerAndZoom(new GPoint(-1,54),12);

When using the get via a map feature it is handy if you do not need to click and zoom through most of the world just to get to your own country.

I wrote the above back in October for use with a very old version of the map module, however the method to change the default location for the map is no longer valid. I cannot see where to change now it either.

Could anyone please help me to make the 'get via a map' feature start centered on a particular location with a particular zoom level.

Regards, Dave

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2006-01-14 13:04
djrm2 wrote:
If the feature could be re-written in a more portable way then I suggest that it should be. Alternativeley an otion to enable the various parts would be good. Removing the broken bit completely as I have shown is better for me than leaving it as it was.

Regards, Dave.

Yes that's the route I want to take. I'll be removing that curl deal (I don't even have curl on any of my installs) and replacing with a more portable way (built-in function of PHP can do the same)

Thanks for your efforts :)

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2006-01-14 13:04
djrm2 wrote:
When using the get via a map feature of edit album to fill the coordinates there is an error saving the coordinates from time to time. This appears to be due to the very large number of digits after the decimal point.

For example here are two locations, the first is as obtained from the get via a map feature the second has the last digit of the lattitude removed. the first is impossible to save, the second is ok.

-1.6533136367797852, 54.22683320135782
-1.653313636779785, 54.22683320135782

hth Dave.

Thx, I'll chnage the preg :)

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2006-01-14 13:13
djrm2 wrote:
I wrote the above back in October for use with a very old version of the map module, however the method to change the default location for the map is no longer valid. I cannot see where to change now it either.

That wouldn't work becasue now, the code automatically look for already existing coordinates to use as a start

djrm2 wrote:
Could anyone please help me to make the 'get via a map' feature start centered on a particular location with a particular zoom level.
Regards, Dave

In GPSMap.inc, after line 107, you can add these:

if (!array_key_exists('coordinates',$map) or (array_key_exists('coordinates',$map) and $map['coordinates'] == "") $map['coordinates']="-1,54";
if (!array_key_exists('zoomlevel',$map) or (array_key_exists('zoomlevel',$map) and $map['zoomlevel'] == "") $map['zoomlevel']=12;

See you !

 
djrm2
djrm2's picture

Joined: 2005-10-04
Posts: 54
Posted: Sat, 2006-01-14 14:06
Termitenshort wrote:
djrm2 wrote:
I wrote the above back in October for use with a very old version of the map module, however the method to change the default location for the map is no longer valid. I cannot see where to change now it either.

That wouldn't work becasue now, the code automatically look for already existing coordinates to use as a start

djrm2 wrote:
Could anyone please help me to make the 'get via a map' feature start centered on a particular location with a particular zoom level.
Regards, Dave

In GPSMap.inc, after line 107, you can add these:

if (!array_key_exists('coordinates',$map) or (array_key_exists('coordinates',$map) and $map['coordinates'] == "") $map['coordinates']="-1,54";
if (!array_key_exists('zoomlevel',$map) or (array_key_exists('zoomlevel',$map) and $map['zoomlevel'] == "") $map['zoomlevel']=12;

Thanks Termite, To make the idea work I had to change the lines you suggested to the following:

if( !array_key_exists('coordinates',$map)
or(array_key_exists('coordinates',$map) and $map['coordinates'] == "")
)
$map['coordinates']="-1,54";

if( (!array_key_exists('zoomlevel',$map))
or( (array_key_exists('zoomlevel',$map)) and ($map['zoomlevel'] == "") )
)
$map['zoomlevel']=12;
Regards, Dave.

 
djrm2
djrm2's picture

Joined: 2005-10-04
Posts: 54
Posted: Sat, 2006-01-14 14:13

Greetings from North Yorkshire.

I have just been trying the latest map theme and have been suprised to find that it still uses the custom field GPS.
I think it would be much nicer if it were to use the same coordinate storage method as used by the map module.
If this was the case then it would save a lot duplication and consequent copy and paste of location information.
Perhaps the option of using one or the other would be the ideal solution for if the map module was not available.
Am I missing something, or has it just never been thought of?

Dave

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2006-01-14 14:37
djrm2 wrote:
Greetings from North Yorkshire.

I have just been trying the latest map theme and have been suprised to find that it still uses the custom field GPS.
I think it would be much nicer if it were to use the same coordinate storage method as used by the map module.
If this was the case then it would save a lot duplication and consequent copy and paste of location information.
Perhaps the option of using one or the other would be the ideal solution for if the map module was not available.
Am I missing something, or has it just never been thought of?

Dave

The modules used to use CustomField as wel (remember a while ago) but it was very inconvenient to add feature to the "itemEdit" plugin so I had decided to create my own table :)

The thing is, if the module isn't installed, the table isn't there.

For it is best to keep the two separated until te map module turns out to have the same feature and then the theme wouldn't bee too usefull anymore.

In the mean time, if you wish to copy all of your information from the module to the theme it can be done via the database edit.
The Table mapMap has the same format as the customeditMap table. Moving all the data from one to the other would result in a mass copy of the GPS coordinates :)

Let me know if that make sense.

 
djrm2
djrm2's picture

Joined: 2005-10-04
Posts: 54
Posted: Sat, 2006-01-14 14:39

Here in the UK the longitude 0 passes right through the middle of the country.
If I have the option 'Enable the dateline fix' enabled then I get strange results.
Markers E of 0 do not appear on the map when the map is centered to the West of 0, and vice-versa.
The problem dissapears if the enable dataline fix is disabled.
Is this the reason for the option, I wonder?
hth Dave.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2006-01-14 14:44

Greetings !!

I am proud to annouce a potential fix for the PG theme issue. It's a nice theme and it's a shame that the module wasn't working on it. After all there should no reason.

Well in fact the PG theme was rewriting all of the Mouse Event and so preventing the map from functioning correctly. It seems that it can be resolved but 2 things need to be changed.

Theme.js (part of the PGtheme) and MapHeader.tpl (part of the map module)

MapHeader.tpl at the end of the file before

    //]]>
</script>
{/if}

Just add var GoogleMap = true; so that we have a variable to transfert to the theme javascript to know if Google Map are shown :)

theme.js
Look for the line var browser = new Browser();

and simply replace it with if (!GoogleMap) {var browser = new Browser();}

Let me know if it fixes also other people installs beside mine :D

-------------------------
The Termite :-)

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2006-01-14 14:46
djrm2 wrote:
Here in the UK the longitude 0 passes right through the middle of the country.
If I have the option 'Enable the dateline fix' enabled then I get strange results.
Markers E of 0 do not appear on the map when the map is centered to the West of 0, and vice-versa.
The problem dissapears if the enable dataline fix is disabled.
Is this the reason for the option, I wonder?
hth Dave.

the "dateline fix" is supposed to fix an issue in the pacific ocean. I didn't check to see if there was "border effects" to that option.

I'll take a look

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Sat, 2006-01-14 14:55
djrm2 wrote:
I have just been trying the latest map theme and have been suprised to find that it still uses the custom field GPS.
I think it would be much nicer if it were to use the same coordinate storage method as used by the map module.
If this was the case then it would save a lot duplication and consequent copy and paste of location information.
Perhaps the option of using one or the other would be the ideal solution for if the map module was not available.
Am I missing something, or has it just never been thought of?

Dave

The Map Theme did not work at all prior to the latest release.
I got interested in it after helping t001z get it working. In
that process I made several other improvements(?) and put it
out there. It's state is one of legacy and it will be
assimilated (into the Map Module). Little or no effort will go
into furthering it's life as the efforts are mainly geared
toward The Module. If I have some time and find the
inclination, I might have a look at what you suggest (it would
certainly make sense) and do it.
You could, of course, take it on and implement/incorporate
your suggestion. :-)

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Sat, 2006-01-14 15:18
djrm2 wrote:
The reference to curl in the commented out section is the only reference to curl in the whole of gallery2 - so I guess curl does not work on my system, and probably on many others too.

Using the following snippet (and if you can directly run php
from a URL) you can test whether curl works on a server.

<?php
$ch = curl_init("http://www.example.com/");
curl_exec($ch);
?>

Save it as testcurl.php on your server and access it via
your browser. If it works it will produce this in your
browser:

You have reached this web page by typing "example.com",
"example.net", or "example.org" into your web browser.

These domain names are reserved for use in documentation and
are not available for registration. See RFC 2606, Section 3.
 
djrm2
djrm2's picture

Joined: 2005-10-04
Posts: 54
Posted: Sat, 2006-01-14 15:30

Galmoid,

Thank you for your incite into the future of the theme. I agree that future effort would be better spent unifying the two projects as they have so many similarities.

However at present the map theme and map module are complimentary.

The theme is picture centered, it shows a selection of pictures and their location on the map.
The map module shows a map by default and allows the user to then see the individual pictures, or album.

The module is far more sophisticated as it allows drilling down through albums to show markers, and much more besides.

If the map module had a photo browser like the theme does then I think the theme would be redundant. I am not much of a php programmer and wouldn't know where to start altering it.

Regards, Dave.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2006-01-14 15:55
djrm2 wrote:
If the map module had a photo browser like the theme does then I think the theme would be redundant. I am not much of a php programmer and wouldn't know where to start altering it.

That's in the plan :)