You are not logged in! If you have not registered yet then click here to join the community!

TOLRA Community Forums


Go Back   TOLRA Community Forums > TOLRA Products (PHP Scripts) > Web Directory Script > Directory Script Mods

Notices

Reply
 
Thread Tools Display Modes
  #31  
Old 25-03-2012, 12:30 PM
Pnop Pnop is offline
Junior Member
 
Join Date: Aug 2009
Posts: 13
Hi Paul,

Sorted the other issue many thanks.

However I now have to change the google maps api key as they have changed the terms and looks lik they are going to start charging for it.

Is there anyway we can change this to utilise the Bing maps if this is the case?

Also I have changed the key but the google maps doesn't appear to work now anyway, at least not for new listings.
Reply With Quote
Sponsored Links
  #32  
Old 25-03-2012, 12:40 PM
Paul's Avatar
Paul Paul is offline
Moderator
 
Join Date: May 2006
Location: UK
Posts: 568
Blog Entries: 3
We didn't create this mod, but there's no reason a mod can't be written for any of the map systems out there, you just need to decide on the map you want to use and the features you want, then a PHP/JavaScript developer should be able to create it for you.

Google maps should work with a new API key, just make sure that you have a key for the correct version of the API, looks like V2.
Reply With Quote
  #33  
Old 24-07-2012, 11:38 AM
jasminedir jasminedir is offline
Junior Member
 
Join Date: Jul 2012
Posts: 26
And what happens if someone haven't completed properly the business address? Eg... missing zip code... or street... etc.
Reply With Quote
  #34  
Old 24-07-2012, 11:43 AM
Paul's Avatar
Paul Paul is offline
Moderator
 
Join Date: May 2006
Location: UK
Posts: 568
Blog Entries: 3
Then in the case of this mod you get a bad location map.
Reply With Quote
  #35  
Old 05-11-2012, 12:55 PM
jasminedir jasminedir is offline
Junior Member
 
Join Date: Jul 2012
Posts: 26
How to update this mod to api v 3?
__________________
My Tolra script based directory!
Reply With Quote
  #36  
Old 05-11-2012, 03:26 PM
Paul's Avatar
Paul Paul is offline
Moderator
 
Join Date: May 2006
Location: UK
Posts: 568
Blog Entries: 3
You'll need to modify the links to the Google maps libraries to be those of V3 and also all the code in the .js file will need to be rewritten to the V3 equivalents.
Reply With Quote
  #37  
Old 20-11-2013, 01:48 PM
John John is offline
Senior Member
 
Join Date: Jul 2006
Location: Brisbane, Australia
Posts: 125
Has anybody an updated version of the Gmap extension now that Google has turned off V2?
https://developers.google.com/maps/d...t/v2/reference
Reply With Quote
  #38  
Old 09-12-2013, 12:38 AM
jasminedir jasminedir is offline
Junior Member
 
Join Date: Jul 2012
Posts: 26
Paul, I tried several times, but all I get is a blank image.

Could you possibly help us a bit, please?

right now the code we must insert in wddetail is:
Code:
 <script type="text/javascript"
      src="https://maps.googleapis.com/maps/api/js?key=API_KEY&sensor=SET_TO_TRUE_OR_FALSE">
    </script>
This is the migration tutorial:

https://developers.google.com/maps/d...ript/v2/v2tov3

OK, Now, in googlemaps.js we have:

Code:
var map = null;
var geocoder = null;

function showAddress(address) {
if (GBrowserIsCompatible()) {
myPano = new GStreetviewPanorama(document.getElementById("pano"));
map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);

map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());

svOverlay = new GStreetviewOverlay();
map.addOverlay(svOverlay);


geocoder = new GClientGeocoder();

if (geocoder) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
alert(address + " not found");
} else {

map.setCenter(point, 14);
var marker = new GMarker(point);
myPano.setLocationAndPOV(point);
map.addOverlay(marker);

}
}
);
}

}
}
I tried several times to follow the tutorial, but still an empty image is what i get.

What am I missing?
__________________
My Tolra script based directory!

Last edited by jasminedir; 09-12-2013 at 12:46 AM.
Reply With Quote
  #39  
Old 09-12-2013, 02:07 AM
Paul's Avatar
Paul Paul is offline
Moderator
 
Join Date: May 2006
Location: UK
Posts: 568
Blog Entries: 3
To load up the API I think you'll want:
Code:
<script type="text/javascript"
      src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false" />
https://developers.google.com/maps/d...ocoding-simple contains an example of geocoding.

I've not bothered with it as when I messed around with it for a project and found it was too easy to get failures for too many queries. In the end I had to acquire a post code to lat/lng database and then use ajax calls to resolve the location with that before creating markers on the maps. It was for a slightly different use case than this.

If you use the codeAddress function from that example you should then be able to feed the lat/lng to the street view example https://developers.google.com/maps/d...eetview-simple

Something like:

Code:
function showAddress(address) {
  var location,
 geocoder = new google.maps.Geocoder();
  geocoder.geocode( { 'address': address}, function(results, status) {
    if (status == google.maps.GeocoderStatus.OK) {
      location = results[0].geometry.location;
    } else {
      alert('Geocode was not successful for the following reason: ' + status);
    }

  var mapOptions = {
    center: location,
    zoom: 14
  };
  var map = new google.maps.Map(
      document.getElementById('map_canvas'), mapOptions);
  var panoramaOptions = {
    position: location,
    pov: {
      heading: 34,
      pitch: 10
    }
  };
  var panorama = new  google.maps.StreetViewPanorama(document.getElementById('pano'),panoramaOptions);
  map.setStreetView(panorama);
}

Last edited by Paul; 09-12-2013 at 09:21 AM. Reason: map-canvas should have been map_canvas
Reply With Quote
  #40  
Old 09-12-2013, 03:42 AM
John John is offline
Senior Member
 
Join Date: Jul 2006
Location: Brisbane, Australia
Posts: 125
Oops, forgot to post my solutions. I have an updated version, not including street view, here is an example:

Gold Coast Hinterland Accommodation

I can post the code later today if you like, or you should be able to figure it out from the source of the above page.

Last edited by John; 09-12-2013 at 03:45 AM.
Reply With Quote
Reply

Bookmarks

Tags
google maps, google street view

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:22 AM.