how to incluse the API into a JavaScript file

1 view
Skip to first unread message

ftbk86

unread,
May 22, 2008, 5:45:09 AM5/22/08
to Google AJAX API
this code:
please help me;
I have to include the jsapi in a js flie,

<script type="text/javascript" src="http://www.google.com/jsapi"></
script>
<script type="text/javascript">
google.load("language", "1");
function FTranslate(text) {
google.language.translate(text, "en", "es", function(result) {
if (!result.error) {
container.innerHTML = result.translation;
alert(container.innerHTML);
}
});
}
//google.setOnLoadCallback(initialize);
</script>
<script>
document.onmousemove = mouseMove;
var cx;
var cy;
var text;
window.setInterval(timeProc,1000,'');
function mouseMove()
{
cx = window.event.x;
cy = window.event.y;
var sel=document.body.createTextRange();
sel.moveToPoint(window.event.x, window.event.y);
sel.expand("word");
//sel.select();
text = sel.text;
}
function timeProc()
{
var tmpsel=document.body.createTextRange();
tmpsel.moveToPoint(cx, cy);
tmpsel.expand("word");
var tmpText = tmpsel.text;
if(tmpText == text )
{
if(tmpText.length >0)
{
//alert(tmpText);
FTranslate(tmpText);
}
}
}
</script>

thebeuis

unread,
May 22, 2008, 6:11:46 AM5/22/08
to Google-AJAX...@googlegroups.com
this does not explain what i want to do??

2008/5/22 ftbk86 <ftb...@gmail.com>:



--
Thank you

From The Beuis +90 0252 3671620 - www.mp3djtechnology.com

jgeerdes [AJAX APIs "Guru"]

unread,
May 22, 2008, 7:16:18 AM5/22/08
to Google AJAX API
Unfortunately, no, your code alone does not explain what you're
wanting to do. If you could please provide a link to your
application, plus a detailed description of what you are trying to
accomplish, that would be most helpful.

That said, what you described - taking the jsapi and related files and
placing them in your own JS file - is probably not the greatest idea
for a couple of reasons. First, the jsapi is actually comprised of a
number of different JS files, depending on what API you're trying to
load, so it's difficult to say exactly what you're going to need. And
second, more importantly, the TOU clearly state that Google reserves
the right to compel you to update to the latest version, and since the
dev team pushes tweaked versions every few days, you will spend more
time updating your files than anything else to comply with this TOU
requirement.

Jeremy R. Geerdes
Effective website design & development
Des Moines, IA

For more information or a project quote:
http://jgeerdes.home.mchsi.com
jgee...@mchsi.com

If you're in the Des Moines, IA, area, check out Debra Heights
Wesleyan Church!

thebeuis

unread,
May 22, 2008, 2:08:19 PM5/22/08
to Google-AJAX...@googlegroups.com
please help

All I want to do is make the map that is on findinbodrum.com searchable with results that I can put on the map.
I have a MYMAP created in google maps that I can place markers on etc.. so how do I search this map from the map on findinbodrum.com

the map findinbodrum.com was just created from the AJAX Wizard.

do i need to use a MYMAP key if so where is it?



2008/5/22 jgeerdes [AJAX APIs Guru] <jgee...@mchsi.com>:

jgeerdes [AJAX APIs "Guru"]

unread,
May 22, 2008, 4:22:43 PM5/22/08
to Google AJAX API
Unfortunately, the AJAX LocalSearch object used in the
GSmapSearchControl (i.e., map search wizard) will not search specific
MyMaps. So you really have two options here:

1. Build a custom map, export your MyMaps map as KML, and use the
Maps API's GGeoXML functionality to load the kml (assuming it's within
the size limitations of the Maps API) onto your map as an overlay.
Advantages: Relatively quick and simple; the Maps API will handle
most of it for you. Disadvantages: You won't be able to really
search the markers; they'll be there or not.

Or

2. Move the information you placed in MyMaps into a suitable
database, coupled with a server-side script of some sort that will
search that database and return the information either through AJAX or
a dynamic kml file.

jg

thebeuis

unread,
May 22, 2008, 10:30:48 PM5/22/08
to Google-AJAX...@googlegroups.com
you say will not search specific MyMaps??

then what will it search??

2008/5/22 jgeerdes [AJAX APIs Guru] <jgee...@mchsi.com>:

jgeerdes [AJAX APIs "Guru"]

unread,
May 22, 2008, 10:35:29 PM5/22/08
to Google AJAX API
The LocalSearch method will search Google's Local index and/or ALL
indexed KML files (which may have been generated by any number of
MyMaps, plus any number of other applications as well), depending on
how you use the .setRestriction method (or don't).

jg

thebeuis

unread,
May 22, 2008, 10:42:32 PM5/22/08
to Google-AJAX...@googlegroups.com
why on earth would i build a MY MAP if i can not search it from a web page??

2008/5/23 jgeerdes [AJAX APIs Guru] <jgee...@mchsi.com>:

thebeuis

unread,
May 22, 2008, 10:48:47 PM5/22/08
to Google-AJAX...@googlegroups.com
when other people search a map what map are they searching??

2008/5/23 thebeuis <theb...@googlemail.com>:

jgeerdes [AJAX APIs "Guru"]

unread,
May 22, 2008, 11:02:56 PM5/22/08
to Google AJAX API
As I said previously, the LocalSearch class searches Google's Local
index and/or ALL KML files they've indexed from MyMaps and elsewhere.
It can be centered on a certain area, soft restricted to a given
radius, and a number of other things. It just won't allow you to
specify a particular MyMaps KML for an exclusive search.

That said, I think such functionality could be compelling, and I would
recommend that, if you want to see it, you add it to the suggested
features/bug tracker database. The dev team has demonstrated that
they will respond to requests such suggestions.

jg

thebeuis

unread,
May 22, 2008, 11:11:22 PM5/22/08
to Google-AJAX...@googlegroups.com
where is suggested
features/bug tracker database..

i think i will have to wait a while for this

2008/5/23 jgeerdes [AJAX APIs Guru] <jgee...@mchsi.com>:

jgeerdes [AJAX APIs "Guru"]

unread,
May 22, 2008, 11:12:26 PM5/22/08
to Google AJAX API

thebeuis

unread,
May 22, 2008, 11:28:32 PM5/22/08
to Google-AJAX...@googlegroups.com
Thank you dude me a newbie

i program flash and director very very well and i can not get what i want from google maps this is very very bad indeed.
i also have first class degree in technology and i can not get what i want from google maps.

the only reason anybody would take the time to build a MY MAP is if it was searchable on there web page.

2008/5/23 jgeerdes [AJAX APIs Guru] <jgee...@mchsi.com>:

Ben Lisbakken

unread,
May 23, 2008, 12:49:42 PM5/23/08
to Google-AJAX...@googlegroups.com
Thebeuis --

Index your KML faster here (http://code.google.com/apis/kml/documentation/kmlSearch.html) :)

-Ben

thebeuis

unread,
May 23, 2008, 4:10:00 PM5/23/08
to Google-AJAX...@googlegroups.com
Thank you Ben Lisbakken I think I understand but dont you think it would be a thousand times easier for all users of googlemaps even the final users if I could just use the ajax api wizard and make it search MY MAP.

Is there any time soon that this may happen??

2008/5/23 Ben Lisbakken <lisb...@google.com>:
Reply all
Reply to author
Forward
0 new messages