Note that there are some explanatory texts on larger screens.

plurals
  1. POOverlay in google maps
    primarykey
    data
    text
    <p>I have a problem with overlays in google maps.</p> <p>the problem is iam using latitude and longitude from the database to display overlay but its not showing the overlay</p> <pre><code>&lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt; &lt;%@page import="java.sql.*" %&gt; &lt;% Connection connection = null; boolean foundResults = false; ResultSet set = null; Statement statement = null; String lat=null; String lng=null; %&gt; &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta name="viewport" content="initial-scale=1.0, user-scalable=no"/&gt; &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8"/&gt; &lt;title&gt;Google Maps JavaScript API v3 Example: Geocoding Simple&lt;/title&gt; &lt;link href="http://code.google.com/apis/maps/documentation/javascript/examples/standard.css" rel="stylesheet" type="text/css" /&gt; &lt;script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var map; function initialize() { var myLatLng = new google.maps.LatLng(18.9, 72.8); var myOptions = { zoom: 11, center: myLatLng, mapTypeId: google.maps.MapTypeId.TERRAIN }; map = new google.maps.Map(document.getElementById("map_canvas"),myOptions); see(); } function see() { &lt;% int count=0; try { Class.forName("org.postgresql.Driver"); connection = DriverManager.getConnection("jdbc:postgresql://localhost:5432/postgres","postgres", "password"); statement = connection.createStatement(); set = statement.executeQuery("SELECT count(lat) from latng"); while(set.next()) { count = set.getInt(1); } } catch(Exception e) { } %&gt; var locations = new Array(&lt;%= count%&gt;); for(i = 0; i &lt; locations.length; i++) { locations[i] = new Array(&lt;%= count%&gt;); } &lt;% int i=0; try { Class.forName("org.postgresql.Driver"); connection = DriverManager.getConnection("jdbc:postgresql://localhost:5432/postgres","postgres", "password"); statement = connection.createStatement(); set = statement.executeQuery("SELECT lat, lng FROM latng"); while(set.next()) { lat=set.getString(1); lng=set.getString(2); %&gt; locations[&lt;%= i %&gt;][0]=&lt;%= lat%&gt;; locations[&lt;%= i %&gt;][1]=&lt;%= lng%&gt;; &lt;% i++; } %&gt; var i; var infowindow = new google.maps.InfoWindow(); var marker; for (i = 0; i &lt; locations.length; i++) { marker = new google.maps.Marker({position: new google.maps.LatLng(locations[i][0],locations[i][1]),map: map}); var flightPlanCoordinates=[new google.maps.LatLng(locations[i][0],locations[i][1])]; var flightPath = new google.maps.Polyline({ path: flightPlanCoordinates, strokeColor: "#FF0000", strokeOpacity: 1.0, strokeWeight: 2 }); flightPath.setMap(map); } &lt;% } catch(Exception e) { } %&gt; } &lt;/script&gt; &lt;/head&gt; &lt;body onload="initialize()"&gt; &lt;div id="map_canvas" style="width=100%; height:80%"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Thanks please some one help me...............</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload