Google Maps javascript API V3 a bugger. Do not place the map DIV in the table

Source: Internet
Author: User

<% @ Page Language = "C #" autoeventwireup = "true" codefile = "map. aspx. cs" inherits = "map" %>

<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head id = "head1" runat = "server">
<Title> No title page </title>
<Style type = "text/CSS">
HTML {Height: 100%}
Body {Height: 100%; margin: 0px; padding: 0px}
# Map_canvas {Height: 100%}
</Style>
<SCRIPT type = "text/JavaScript" src = "http://maps.google.com/maps/api/js? Sensor = false "> </SCRIPT> <% -- sensor parameter to indicate whether the application uses sensors to determine the user's location -- %>
<SCRIPT src = "scripts/jquery-1.4.2.min.js" type = "text/JavaScript"> </SCRIPT>
<SCRIPT type = "text/JavaScript">
VaR map;
$ (Function (){
VaR mylatlng = new Google. Maps. latlng (24.47056849943595, 118.11364889144897 );
VaR myoptions = {
Zoom: 21,
Center: mylatlng,
Maptypeid: Google. Maps. maptypeid. Roadmap
}
Map = new Google. Maps. Map (document. getelementbyid ("map_canvas"), myoptions );
Bf_restaurant_service.selectby_latlngzoomws _ bf_restaurant _ (24, 25,117,119, 1, onget1_antsucceed_dhx, onget1_anterror_dhx );
});

Function ongetrestaurantsucceed_dhx (reslist_dhx ){
Alert (reslist_dhx );
If (reslist_dhx = NULL) return;
For (I = 0; I <reslist_dhx.length; I ++ ){
Alert (reslist_dhx [I]. LAT latitude + "," + reslist_dhx [I]. lng longitude );
VaR mylatlng = new Google. Maps. latlng (reslist_dhx [I]. LAT latitude, reslist_dhx [I]. lng longitude );
VaR marker = new Google. Maps. Marker ({
Position: mylatlng,
Map: map,
Title: reslist_dhx [I]. Name
});
}
}

Function ongetrestauranterror_dhx (err_dhx ){
Alert (err_dhx.get_message ());
}

</SCRIPT>
</Head>
<Body>

<Table>

<Tr>

<TD> </TD>

<TD> <Div id = "map_canvas"> </div> </TD>

</Tr>

</Table>
<Form ID = "form1" runat = "server">
<Asp: scriptmanager id = "scriptmanager1" runat = "server">
<Services>
<Asp: servicereference Path = "~ /Bf_restaurant/bf_restaurant_service.asmx "/>
</Services>
</ASP: scriptmanager>
</Form>
</Body>
</Html>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.