<script type="text/javascript">
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
}
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()">
<div id="map_canvas" style="width: 500px; height: 300px"></div>
</body>
Code language: HTML, XML (xml)
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
map.openInfoWindow(map.getCenter(),
document.createTextNode("Hello, world"));
}
}
Code language: JavaScript (javascript)
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(18.4419, 73.1419), 8);
map.addControl(new GLargeMapControl());
map.addControl(new GScaleControl());
GEvent.addListener(map, "click", function(marker, point) {
if (marker) {
} else {
var marker = new GMarker(point);
map.addOverlay(marker);
var lat = point.y;
var lng = point.x;
marker.openInfoWindowHtml("Latitude:"+lat+"<br/>Longitude:"+lng);
}
});
}
}
Code language: JavaScript (javascript)
Java URL Encoder/Decoder Example - In this tutorial we will see how to URL encode/decode…
Show Multiple Examples in OpenAPI - OpenAPI (aka Swagger) Specifications has become a defecto standard…
Local WordPress using Docker - Running a local WordPress development environment is crucial for testing…
1. JWT Token Overview JSON Web Token (JWT) is an open standard defines a compact…
GraphQL Subscription provides a great way of building real-time API. In this tutorial we will…
1. Overview Spring Boot Webflux DynamoDB Integration tests - In this tutorial we will see…
View Comments
in Latitude/Longitude tracing demo
change getElementById("map") to (document.getElementById("map_canvas"));
Nice posting.
I do customization and used my application.
I like to know, is there any way to find the location by zip code using geocode api
Hi,
Can any one tell me how can i integrate java with google api.
are there any references for this problem.
hi guys,
I need a tutorial for this kind of application:
- an app that gets my location and shows it with a marker on Google map.
- this app should have a button and when I click on it:
It select from my database nearest restaurants (within any range, maybe 1 miles) and show them with markers on the map.
=>of course restaurants are stored in the database with their names and coordinates (latitude & longitude).
If anyone ever seen any tutorial to do such an app, please tell me.
Thx