Berkeley CSUA MOTD:Entry 38863
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/27 [General] UID:1000 Activity:popular
5/27    

2005/7/28-29 [Computer/SW/Languages/Misc, Computer/SW/Languages/JavaScript] UID:38863 Activity:nil
7/28    How easy/hard is it to use Google Map's interface? Do you have
        to be a JavaScript expert? How many lines of code to write
        something simple?
        \_ http://csua.org/u/cus
           You have to know a little JS, but their examples in the docs will
           give you the general idea.  --dbushong
2025/05/27 [General] UID:1000 Activity:popular
5/27    

You may also be interested in these entries...
2013/4/9-5/18 [Computer/SW/Mail, Academia/Berkeley/CSUA] UID:54647 Activity:nil
4/8     What's a good free e-mail provider? I don't want to use Gmail,
        Yahoo, Outlook, or any of those sites with features I never use that
        track my personal info and keep changing their interface. I want just
        simple e-mail without privacy issues or all the baggage these large,
        for-profit companies are adding. I might even be willing to pay.
        Recommendations?
	...
2010/8/8-9/7 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Web] UID:53914 Activity:nil
8/8     Trying to make a list of interesting features languages have
        touted as this whole PL field comes around, trying to see if they
        have basis in the culture of the time: feel free to add some/dispute
        1970 C, "portability"
        1980 C++, classes, oop, iterators, streams, functors, templates
             expert systems
	...
2009/9/28-10/8 [Computer/SW/Languages/C_Cplusplus] UID:53409 Activity:nil
9/28    http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
        Java is #1!!! Followed by C, PHP, C++, Visual Basic, Perl,
        C#, Python, Javascript, then finally Ruby. The good news is
        Pascal is going waaaay back up!
        \_ C is still more popular than C++?  I feel much better about myself
           now.
	...
2009/8/3-11 [Computer/SW/Languages/Web] UID:53231 Activity:moderate
8/1     Where's the place people go for free webspace these days?  Helping
        my sis's  kid learn how to set up html/php/some minor javascript.
        \_ not geocities:
           http://help.yahoo.com/l/us/yahoo/geocities/close/close-07.html
        \_ why are there 2987394872 places offering free blog space but
           not alot offering free webspace like before.
	...
2009/7/21-24 [Computer/SW/Languages/Java] UID:53168 Activity:moderate
7/20    For those who care btw, it looks like eclipse is now A Standard Tool
        at UCB ugrad cs, probably replaced emacs.  Furthermore, people get
        angry at seeing Makefiles, (since eclispe takes care of that).  I
        guess it's just a sign of the times.
        \_ The more people at my work use eclipse the less the code is
           managable in emacs.  I'm not sure which application's fault
	...
2009/6/30-7/15 [Computer/SW/Languages/JavaScript] UID:53098 Activity:nil
6/30    Javascript, I love you:
        var b = new Boolean(false);
        b;        // false
        !b;       // ALSO false
        !b == b;  // But this is true!
        !!b == !b // Negate both sides and it's false again. FUCK.
	...
2008/9/22-24 [Science/Electric, Computer/Companies/Google, Computer/SW/Editors/Vi] UID:51263 Activity:kinda low
9/22    Gmail's "conversation feature" drives me nuts! Is there a way to
        disable that and make Gmail act like every other e-mail client on the
        planet? WTF thought this was a nice thing to have on by default?
        \_ Umm, why don't you just use another email service then...
           \_ Umm, I do, which is how I have something to compare to. I get
              mail in at least 4 places only one of which is Gmail. I
	...
2008/6/17-20 [Computer/SW/WWW/Browsers] UID:50275 Activity:kinda low 57%like:50273
6/16    Firefox 3 coming out tomorrow.
        http://news.yahoo.com/s/nf/20080612/bs_nf/60269
        Memory usage - Firefox 3 Beta vs. Firefox 2 vs. IE 7:
        http://blog.pavlov.net/2008/03/11/firefox-3-memory-usage
        \_ There's a rule that says NEVER BE THE FIRST TO TRY IT.
           I'm going to let Firefox3 version 1 hammer out bugs first.
	...
2008/3/4-7 [Computer/SW/Virus] UID:49325 Activity:kinda low
3/4     Hi, what's the best free anti-virus software for XP?  What about
        anti-spyware?  Currently I'm using Active Virus Shield and Spybot.
        Thanks.
        \_ I've used: avg, spybot s&d, adaware, trend micro's housecall.
           \_ Does Spybot S&D protect Firefox?  It soulds like the injection
              feature only supports IE.
	...
2008/3/5-7 [Computer/Companies/Google] UID:49346 Activity:kinda low
3/5     How does Google Map widget work? Is it a flash program or a
        pure Javascript program? When you include a Google Map on your
        home page, how does it talk to the <DEAD>maps.google.com<DEAD> server?
        I thought cross domain is not possible.
        \_ Pure JavaScript.  It uses an <iframe> to avoid cross-domain issues.
           \_ You mean the thing that scrolls/moves around is an
	...
2008/2/7-11 [Computer/SW/Languages] UID:49084 Activity:low
2/7     Hi I'd like to learn Flash. I have no UI experience but I just want to
        learn for the sake for curiosity. I just want to create something that
        is interactive and fun, and don't care about scalability/extensibility/
        reliability/efficiency/blah-blah. What language is Flash most similar
        to and how easy/difficult is it to get started (e.g. "hello world")?
        -kchang
	...
Cache (8192 bytes)
csua.org/u/cus -> www.google.com/apis/maps/documentation/#The_Hello_World_of_Google_Maps
Properties Introduction The "Hello World" of Google Maps The easiest way to start reading about an API is to see a simple example. file=api&v=1&key=abcdefg" type="text/javascript"></script> </head> <body> <div id="map" style="width: 300px; height: 300px"></div> <script type="text/javascript"> //<! file=api&v=1) that includes all of the symbols you need to create Google Maps on your pages. file=api&v=1&key=abcdefg" type="text/javascript"></script> The main class exported by the Google Maps API is GMap, which represents a single map on the page. You can create as many instances of this class you want (one for each map on the page). A map is embedded in a contain er, which is typically a div element. The methods for manipulating and adding overlays to map instances are det ailed below. Browser Compatibility Google Maps is not compatible with every web browser. Google Maps current ly supports recent versions of Firefox/Mozilla, IE 55+, Safari 12+, an d sort of supports Opera. Since different appli cations require different behaviors for users with incompatible browsers , the Maps API provides a global method (GBrowserIsCompatible to chec k compatibility, but it does not have any automatic behavior for incompa tible browsers. file=api&v=1 will parse on almost every browser without errors, so you can safely include the script before checking for compatibility. None of the examples in this document besides the one above check for GBr owserIsCompatible(), nor do they print any message for older browsers. C learly real applications should do something more friendly, but we have omitted these checks to make the examples more readable. XHTML and VML We recommend that you use standards-compliant XHTML on pages that contain maps. When browsers see the XHTML DOCTYPE at the top of the page, they execute the page in "standards compliant mode," which makes layout and b ehaviors much more predictable across browsers. Likewise, if you include Polylines on your map, you need to include the V ML namespace in your XHTML document for IE browsers. org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> <head> <style type="text/css"> v\:* { behavior:url(#default#VML); We will try to run the old and new version concurrently for about a month , after which the old version will be turned off. The Maps team will transparently update the API with the most recent bug fixes and performance enhancements. html) Map Movement and Animation The recenterOrPanToLatLng method does a continuous pan if the lat/lng is in the current map viewport, or it does a discrete movement otherwise. html) Adding Controls to the Map You can add controls to the map with the addControl method. In this case, we add the built in GSmallMapControl and GMapTypeControl, which let us pan/zoom the map and switch between Map and Satellite mode. html) Opening an Info Window Displays an info window that points to the center of the map with a simpl e "Hello world" message. Info windows are typically opened above markers , but they can be opened anywhere on the map. html) Map Overlays Creates 10 random markers and a random polyline to illustrate the use of map overlays. Sort the points by longitude so that // the line does not intersect itself. html) Display Info Windows Above Markers In this example, we show a custom info window above each marker by listen ing to the click event for each marker. We take advantage of function cl osures to customize the info window content for each marker. html) Using Icon Classes In many cases, your icons may have different foregrounds, but the same sh ape and shadow. The easiest way to achieve this behavior is to use the c opy constructor for the GIcon class, which copies all the properties ove r to a new icon which you can then customize. html) API Overview The GMap class An instance of GMap represents a single map on the page. You can create a s many instances of this class you want (one for each map on the page). A map is embedded in a container, which is typically a div element. Unle ss you specify a size explicitly, the map will use the size of the conta iner to determine its size. The GMap class exports methods to manipulate the map position (center and zoom level) and add and remove overlays (eg, GMarker and GPolyline in stances). It also exports a method to open an "info window," which is th e popup window you see on Google Maps and Google Local. The map has a si ngle info window, so only one window can be open at a given time. Events You can add dynamic elements to your application using event listeners. addListener(map, "click", function() { alert("You clicked the map"); addListener takes a function as the third argument, which promotes the use of function closures for event handlers. The basic info window method is openInfoWindow, which takes a point and a n HTML DOM element as an argument. The HTML DOM element is appended to t he info window container, and the info window is displayed over the give n point. openInfoWindowHtml is similar, but it takes an HTML string as an argument rather than a DOM element. openInfoWindowXslt takes in an XML DOM eleme nt and the URL of an XSLT document to produce the info window contents, downloading the XSLT asynchronously if it has not already been downloade d by the user's browser. To display an info window above an overlay like a marker, you can pass an optional third argument that gives a pixel offset between the lat/lng p oint passed in and the tip of the info window. So, if your marker was 10 pixels tall, you would pass the pixel offset GSize(0, -10). The GMarker class exports openInfoWindow methods that handle the pixel of fset issues for you based on the size and shape of the icon, so you will generally not have to worry about calculating icon offsets in your appl ication. Overlays Overlays are objects on the map that are tied to lat/lng coordinates, so they move when you drag/zoom the map around and when you switch projecti ons (eg, switch from Map to Satellite mode). The Maps API exports two types of overlays: markers, which are icons on t he map, and polylines, which are lines made up of lat/lng coordinates. Icons and Markers The GMarker constructor takes an icon and a point as arguments and export s a small set of events like "click". html example a bove for a simple example of creating markers. The most difficult part of creating a marker is specifying the icon, whic h is complex because of the number of different images that make up a si ngle icon in the Maps API. Every icon has (at least) a foreground image and a shadow image. The shad ow should be created at a 45 degree angle from the foreground image, and the bottom left corner of the shadow image should align with the bottom -left corner of the icon foreground image. The shadow should be a 24-bit PNG images with alpha transparency so that the edges of the shadow look correct on top of the map. The GIcon class requires you specify the size of these images when you in itialize the icon so the Maps API can create image elements of the appro priate size. This is the minimum amount of code required to specify an i con (in this case, the icon used on Google Maps): var icon = new GIcon(); The GIcon class exports 7 more properties that you should set to get maxi mum browser compatibility and functionality from your icons. For example , the imageMap property specifies the shape of the non-transparent parts of the icon image. If you do not set this property in your icon, the en tire icon image (including the transparent parts) will be clickable in F irefox/Mozilla. Polylines The GPolyline constructor takes an array of lat/lng points as an argument . The color should be in the older HTML style, eg, "#ff0000". In Internet Explorer browser, we use VML to draw polylines. On all other browsers, we request an image of the line from Google servers and overla y that image on the map, refreshing the image as necessary as the map is zoomed and dragged around. The control will be attached to top-left corner of the map just like it i s on Google Maps. XML and RPC The Google Maps API exports a factory method for creating XmlHttpRequest objects that work in recent versions of IE...