G
Govind
Hi All,
I am new to this group and also to google map api.
I am creating when user login then display the location in google map
here my page load code
<script src="http://maps.google.com/maps?
file=api&v=2&key=ABQIAAAAR0ME0_WfKRR1jlHOhBv8YRTqD8KII8nGCHEOs63QpaP31mkaURRl5YsTMPCqNK7Vf1nku6NF6o9Qog&sensor=true"
type="text/javascript"></script>
<script type="text/javascript">
function initialize() {
var ii=document.getElementById("aaa").value;
alert(ii);
var latitude=geoip_latitude();
var longitude=geoip_longitude();
// alert(longitude);
var city=geoip_city();
//alert(city)
var country=geoip_country_name();
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(latitude,longitude ), 7);
var point = new GPoint(longitude,latitude);
var marker = createMarker(point,"<div style=\"font-
family:Arial,Helvetica,Tahoma;font-size:11px;\" align=\"left
\"><strong>City</strong>:"+ city +" <br><strong>Country</strong>:"+
country +"<br><strong>IP Address</strong>:"+ ii +"<br> </div>")
map.addOverlay(marker);
//alert(marker);
map.setUIToDefault();
}
}
</script>
<script type="text/javascript">
function createMarker(point,html) {
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
return marker;
}
it shows the current location
but I also one requirement these are as below
1.
when user enters a city name in the text box i have to show the
proper
location in the map
i also show your code the following url
http://groups.google.com/group/Google-Maps-API/browse_thread/thread/963dc7606c0dae9c#
i also use these code but when i am entering the city name map not set
as per city
Please Help me
Thanks
Govind
I am new to this group and also to google map api.
I am creating when user login then display the location in google map
here my page load code
<script src="http://maps.google.com/maps?
file=api&v=2&key=ABQIAAAAR0ME0_WfKRR1jlHOhBv8YRTqD8KII8nGCHEOs63QpaP31mkaURRl5YsTMPCqNK7Vf1nku6NF6o9Qog&sensor=true"
type="text/javascript"></script>
<script type="text/javascript">
function initialize() {
var ii=document.getElementById("aaa").value;
alert(ii);
var latitude=geoip_latitude();
var longitude=geoip_longitude();
// alert(longitude);
var city=geoip_city();
//alert(city)
var country=geoip_country_name();
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(latitude,longitude ), 7);
var point = new GPoint(longitude,latitude);
var marker = createMarker(point,"<div style=\"font-
family:Arial,Helvetica,Tahoma;font-size:11px;\" align=\"left
\"><strong>City</strong>:"+ city +" <br><strong>Country</strong>:"+
country +"<br><strong>IP Address</strong>:"+ ii +"<br> </div>")
map.addOverlay(marker);
//alert(marker);
map.setUIToDefault();
}
}
</script>
<script type="text/javascript">
function createMarker(point,html) {
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
return marker;
}
it shows the current location
but I also one requirement these are as below
1.
when user enters a city name in the text box i have to show the
proper
location in the map
i also show your code the following url
http://groups.google.com/group/Google-Maps-API/browse_thread/thread/963dc7606c0dae9c#
i also use these code but when i am entering the city name map not set
as per city
Please Help me
Thanks
Govind