4 ms·
Here's some tips from on your mapping site, from a guy who's been there and is there :) 1. Don't spawn a new page for Google Directions. You can show direction
by andrewljohnson 18y ago
Here's some tips from on your mapping site, from a guy who's been there and is there :)
1. Don't spawn a new page for Google Directions. You can show directions on your site and your map:
directions = new GDirections(map, gel('directionsId'));
...
directions.load("from:" + startLoc + " to:" + endLoc);
})
2. You should use a little ajax to fetch waypoints on pan and zoom. For example, using YUI:
GMap2.prototype.getSurroundingData = function () {
size = this.getSize()
center = this.getCenter()
var dataURL = '/get_quadrant/' + center.lat() + '/' + center.lng() + '/' + size.width + '/' + size.height + '/' + this.getZoom();
var cObj = YAHOO.util.Connect.asyncRequest('POST', dataURL, { success: function(o){ this.fetchQuadrantCallback(o)},
scope: this
});
3. Use the new Google zoom control, instead of the old one you use:
this.addControl(new GLargeMapControl3D(), topLeft);
4. Use a function to clear input boxes (such as your search box) when they are clicked:
function clearInitialValue() {
this.value = "";
this.onclick = null
this.style.color = "black";
}
I have other suggestions, and if you are interested email me at andrewljohnson [AT] trailbehind [dot] com.
- wooster 18y agoAll good suggestions, thanks. :)