1

As being new to web site development, I have been able to display map on my website, but I want that I should only zoom to some specific places of India on loading of web pages.

Can somebody please suggest on how to go about it.

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Web Urban Atlas</title>
<link type= text/css rel = stylesheet href="urban_stylesheet.css" />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script type="text/javascript" src="http://openlayers.org/api/2.11/OpenLayers.js"></script>
<style>
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
</style>
<!-- The magic comes here -->
<script type="text/javascript">
    function init() {
    // Create the map using the specified
    // DOM element
    var map = new OpenLayers.Map("rcp1_map");
    // Create an OpenStreeMap raster layer
    // and add to the map
    var osm = new OpenLayers.Layer.OSM();
    map.addLayer(osm);
    // Set view to zoom maximum map extent
    map.zoomToMaxExtent();
}
</script>
<script>
  $(function() {
    $( "#accordion" ).accordion();
  });
</script>
</head>
<body onload="init()">
<div id="header" style= "width: 100%;height:20%;">
<h2>Urban Atlas</h2>
</div>
<div id="rcp1_map" style= "width:80%;height:60%;float:right;">
</div>
<div id="accordion" style="width:20%">
 <h3>Bangalore</h3>
 <div><p>Bangalore is city of gardens</p></div>
  <h3>delhi</h3>
  <div><p>Content for Delhi</p></div>
  <h3>mumbai</h3>
  <div><p>Content for Mumbai</p></div>
</div>
</body>
</html>
nmtoken
  • 13,355
  • 5
  • 38
  • 87
Rajat
  • 49
  • 4
  • Would you be able to review the answers to the question that I have made this a duplicate of, please? If you then think there is a unique requirement that you have which none of the options there cover, then if you edit your question to provide more details about what you have tried and where you are stuck then that is where our users may be able to assist. – PolyGeo Oct 11 '14 at 07:58

0 Answers0