homepage Welcome to WebmasterWorld Guest from 54.235.16.159
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
google maps - when certain keyword entered in search go to URL?
google maps
V3rt3X




msg:4460752
 2:49 pm on Jun 2, 2012 (gmt 0)

Hello,

sorry for bad english in advance. My question is this, if there is a normal website that uses google maps with search function is it possible to redirect user to anoather page from the same site if he enters certain keyword in search?

could you show me how?

here is normal javascript code for google map with search function:

var geocoder;
var map;
function initialize() {
geocoder = new google.maps.Geocoder();
var latlng = new google.maps.LatLng(75.4200, 80.7000);
var myOptions = {
zoom: 7,
center: latlng,
mapTypeId: google.maps.MapTypeId.HYBRID,
panControl: true, panControlOptions: {position: google.maps.ControlPosition.LEFT_TOP}
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
}

function codeAddress() {
var address = document.getElementById("address").value;
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location
});
} else {
alert("Error: " + status);
}
});
}


i know a site that is doing this but in really complicated way + adding some keywords and markers on the map. basicly much more than i need but i dont whant to put the code here couse i dont know if they would like that.

 

V3rt3X




msg:4460754
 2:52 pm on Jun 2, 2012 (gmt 0)

or if you can give me some links or something it would also be helpfull

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved