________________________________ From: "[email protected]" <[email protected]> To: Digest Recipients <[email protected]> Sent: Fri, 2 July, 2010 16:21:44 Subject: [Google Maps API v3] Digest for [email protected] - 25 Messages in 15 Topics Today's Topic Summary Group: http://groups.google.com/group/google-maps-js-api-v3/topics * OVER_QUERY_LIMIT For Elevation Service [4 Updates] * load kml, centre upon it but no zoom? [2 Updates] * Google example map gives error related to width:100% when Doctype strict is added [2 Updates] * Map initialization... [1 Update] * Need help getting my custom tiles to load [1 Update] * Geolocation in android 2.1 browser - no GPS [6 Updates] * Adding Map Service Overlay [1 Update] * Google Map API works in IE7; not in Safari 5 or FF 3.6.6 [1 Update] * v3 map won't print in Firefox [1 Update] * To encode or not - an example [1 Update] * contains of getbounds [1 Update] * Polyline mouseover event to display some sort of message box or tooltip [1 Update] * Enter zip or address, return points of interest within radius [1 Update] * Distance per pixel at a given zoom level [1 Update] * region biasing uk problems getting it to work [1 Update] Topic: OVER_QUERY_LIMIT For Elevation Service JavaJive <[email protected]> Jul 02 05:54AM -0700 ^ I have written a page that finds the best local TV transmitters (this uses Google Maps v2, I am currently trying to adapt it to v3) ... http://www.macfh.co.uk/JavaJive/AudioVisualTV/TerrestrialTV/TerrestrialCalculator.html It works as follows 1: Create a list of all transmitters within 100km sorted by distance. 2: Choose up to the five nearest relays (sub-transmitters) and the five nearest main transmitters. 3: For each look up the transmission powers from my server and attenuate them for distance. 4: Discard any whose signals are too weak to reach the site. 5: For the remaining, get the path elevation. 6: Attenuate the signal powers further according to the terrain. 7: List any remaining above the minimum required level. The currently published version uses a UK-only private elevation service, but I'm trying to get the v3 compatible version to use the Google Elevation Service, using getElevationAlongPath(). As can be seen from the above procedure, the absolute maximum number of paths that will be requested in quick succession is 10, though usually it will be about half that. Nevertheless, despite this small number, I'm getting OVER_QUERY_LIMIT responses. I wasn't able to find any documentation on the actual limits to using this service. What exactly are they, and what can be done to overcome this problem? Rossko <[email protected]> Jul 02 06:55AM -0700 ^ > I wasn't able to find any documentation on the actual limits to using > this service. We can hazard a guess that they are similar to geocoding limits. Another guess would be that you have broken the rate limit, rather than max counts. http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/a9bab8ca2e4d63d/b3f01f010f07f558 Nathan Raley <[email protected]> Jul 02 08:59AM -0500 ^ Taken from google's documentation on it at: http://code.google.com/apis/maps/documentation/elevation/ Use of the Google Elevation API is subject to a query limit of 25,000 elevation location requests per day. Note that on any given query, you may request elevation data for multiple locations, which count as separate queries. Up to 512 locations may be queried within a single request. This limit is enforced to prevent abuse and/or repurposing of the Elevation API, and this limit may be changed in the future without notice. Additionally, we enforce a request rate limit to prevent abuse of the service. If you exceed the 24-hour limit or otherwise abuse the service, the Elevation API may stop working for you temporarily. If you continue to exceed this limit, your access to the Elevation API may be blocked. The Elevation API returns data for single point queries of the highest accuracy possible. Batch queries involving multiple locations may return data with less accuracy, especially if the locations are spread apart, as some smoothing of data occurs. Note: the Elevation API may only be used in conjunction with displaying results on a Google map; using elevation data without displaying a map for which elevation data was requested is prohibited. For complete details on allowed usage, consult the Maps API Terms of Service License Restrictions<http://code.google.com/apis/maps/terms.html#section_10_12> . Then the post Rossko posted gives you more detailed explanations about the usage limiations. JavaJive <[email protected]> Jul 02 07:18AM -0700 ^ To judge from that, I certainly haven't exceeded the number of queries per day (2,500) and am unlikely while testing to exceed the maximum number of points per day (25,000), so it looks like the rate, but that does not appear to be documented anywhere. What can I do about this? Topic: load kml, centre upon it but no zoom? PaulG <[email protected]> Jul 02 06:58AM -0700 ^ I have a number of features in separate kml files, all contained within a pretty tight area. I can load them up dynamically and this works fine, think of a road gazetteer. However I don't want the viewport zooming in and out for these particular features. I want the current viewport to pan to the centre point of the kml file, but stay at the current zoom level. I am supressing the normal map.kmlLayer() with {preserveViewport:true} so do I have any way of finding the centre point of that kmlLayer? The only other way I can think of doing this is to -remember the current zoom level -turn preserveViewport back to false -ZOOM in when the kml load -then ZOOM back out again Which might be a bit disconcerting for users. Nathan Raley <[email protected]> Jul 02 09:03AM -0500 ^ getDefaultViewport() Gets the default viewport for the layer being displayed and returns a LatLngBounds<http://code.google.com/apis/maps/documentation/javascript/reference.html#LatLngBounds> of the Layer you are displaying. LatLngBounds has a getCenter. You could read the current zoom and read the getDefaultViewport and set the map to center on the viewports center and the previous zoom level. Topic: Google example map gives error related to width:100% when Doctype strict is added Joseph Elfelt <[email protected]> Jul 02 06:31AM -0700 ^ I took one of the simple Google v3 demo maps and added: 1. A doctype strict declaration 2. Some CSS from a v2 app that helps the v2 map run full screen without scroll bars Here is the tweaked Google v3 demo map: http://www.mappingsupport.com/forum_post/width_problem_01.html The v3 map displays fine but the Firefox (3.5.10) error console says: Warning: Error in parsing value for 'width'. Declaration dropped. Source File: http://www.mappingsupport.com/forum_post/width_problem_01.html Line: 0 Here is an example of my v2 app where the same CSS does not generate this error: http://www.mappingsupport.com/p/gmap4.php?ll=-34.361576,149.699707&t=m&z=8 I have played with my small v3 test file a great deal but have been unable to make this warning message go away as long as I have Doctype strict. Note that I deleted the 'width' declaration from the map_canvas div since this div will automatically have the width of its container. Am I missing something or is it possible that the code generated by the v3 API is causing this warning? Damsel <[email protected]> Jul 02 06:48AM -0700 ^ This has nothing to do with the version of the API. Your html code is not the same for your two examples.......you're missing the content type from the V3 sample, which is required for strict. <meta http-equiv="content-type" content="text/html;charset=utf-8" /> You're also encapsulating your javascript in the V2 and leaving it out of the V3. <script type="text/javascript"> <!-- your javascript code goes here //--> </script> A good practice is to validate your html (ESPECIALLY when using strict). It will not display properly in all browsers without validation. http://validator.w3.org/ Topic: Map initialization... Kurt Agius <[email protected]> Jul 02 03:33PM +0200 ^ Re: script tag outside the head & body section, i know about it, its because i need to load the body first and then do the resize of the divs. But that's a small thing which can be fixed quickly. I'm expecting that the map center & zoom level are according to the ones i specified when initializing the map. Topic: Need help getting my custom tiles to load Chad Killingsworth <[email protected]> Jul 02 06:28AM -0700 ^ Well step one is your tile urls are returning 404 errors. Try: http://www.darkmatters.org/forums/bradstuff/Map/2_2_1.jpg That's why your map is displaying empty tiles. Chad Killingsworth Topic: Geolocation in android 2.1 browser - no GPS Rolf Dohrmann <[email protected]> Jul 01 11:35PM -0700 ^ Hi, I want to use the w3c geolocation service in android browsers. I tested with HTC Hero android 2.1. Here is the Google sample map that shows how geolocation should work: http://code.google.com/intl/de-DE/apis/maps/documentation/javascript/examples/map-geolocation.html Result: Map is shown. Infowindow: Location found using W3C standard. That's how it should be. But the infowindow points to a place on the map that is (probably) the next cell tower and not my precise location. It seems as if the GPS data are not processed. I decided to do some testing and copied the source code of the page and put it here: http://speibl.com/samples/v3-tutorial-17-geolocation1.html When I open this page in my smartphone then the screen shows nothing but a white browser viewport. My questions are: Should andorid 2.1 be able to do geolocation with GPS data? Why is no GPS data used for geolocation in the sample? Why does the same source code create different results? Any help is highly appreciated. If this can't be fixed I have to stop writing webapps and switch to native apps instead, hoping that geolocation works better with native apps. Thanks a lot, Rolf Rolf Dohrmann <[email protected]> Jul 02 01:18AM -0700 ^ I take back question #3: Why does the same source code create different results? It's because of the css-files, that habe to be stored locally. Rolf Dohrmann <[email protected]> Jul 02 02:26AM -0700 ^ I take back question #3: Why does the same source code create different results? It's because of the css-files, that habe to be stored locally. Rolf Dohrmann <[email protected]> Jul 02 02:58AM -0700 ^ I take back question #3: Why does the same source code create different results? It's because of the css-files, that habe to be stored locally. Rolf Dohrmann <[email protected]> Jul 02 03:15AM -0700 ^ I noticed that the native Google Maps App on my smartphone needs a few seconds until it can change my position from the cell tower position to the real position (GPS). So I wondered if this might be the reason why google maps API in android does not show the correct position but only the cell tower: it might take some time to find out where the real (GPS) position is. But the sample script calls the data only once when initializing. That means it has no time. So I wrote a script that loops about 10 times, each 10 seconds. It calls the current position again and again. However, that didn't work either. http://www.speibl.com/samples/v3-tutorial-17-geolocation1b.html Now I have no more idea how to fix that from my side and I wonder if it is really possible to show the GPS-position in the android browser. Is there any example that shows that it works? I'd like to check that. Perhaps it's a problem related to my smartphone? Chad Killingsworth <[email protected]> Jul 02 06:22AM -0700 ^ navigator.getCurrentPosition takes an optional 3rd argument that is an options object. Try setting the enableHighAccuracy and maximumAge parameters and see what happens. http://dev.w3.org/geo/api/spec-source.html#position_options_interface Chad Killingsworth Topic: Adding Map Service Overlay Russ <[email protected]> Jul 02 05:44AM -0700 ^ Mr. Liu, THANK YOU! Works like a charm in my web application. I wish i could share with you the web site but it is in development within our network only. What I am doing is creating fish sample sites on streams (google.maps markers) from the server through an established sql database reader and building a client side script to pass back to the client, init the map and add the markers to the map. We needed to see all streams within the map and the USA Topo does the trick. With you assistance and thoughtful replys to this post I believe I am well on my way in this (new-to-me) Google API coding world. Again, Thank You very much. Russ p.s. should this issue (post) be marked as resolved? I am sure other developers may have the same questions. Topic: Google Map API works in IE7; not in Safari 5 or FF 3.6.6 Damsel <[email protected]> Jul 02 05:24AM -0700 ^ Please post a link to your page, this is not complete code and there could be any number of reasons why some browsers work and others don't.......and most of those reasons have to do with the bits of code that you left out ;) Topic: v3 map won't print in Firefox Damsel <[email protected]> Jul 02 05:21AM -0700 ^ I'm having the same problem. Topic: To encode or not - an example bratliff <[email protected]> Jul 02 05:10AM -0700 ^ > compression was enabled on the web server, then the download for the > second would be near to 300KB instead of 2 megabytes, and the two > pages would load in similar times. Space could be saved with something like: var p= { x:[lng0,lng1, ... ] , y:[lat0.lat1, ... ] } ; var path=[]; for (var i=0;(p.x[i]!=null)*(p.y[i]!=null);i++) { path[i]=new google.maps.LatLng(p.y[i],p.x[i]); } Of course, Google could support such a structure directly for a huge reduction in overhead. I submitted a suggestion to the issue tracker. It was rejected. Topic: contains of getbounds Rossko <[email protected]> Jul 02 03:14AM -0700 ^ > result is false. > If the point if out the rectangle anywhere obtain false too. > Is a bug of function ?? Whether it is a bug or something wrong in your code, you should provide a demonstration i.e. a link to your page showing the problem. Topic: Polyline mouseover event to display some sort of message box or tooltip Rossko <[email protected]> Jul 02 03:12AM -0700 ^ > I'm currently using the Google Maps Javascript API v3.0 and it doesn't > seem to show anything. We can't see anything at all. A link to your problem page would help, rather than a link to someone else's working example. You've looked at that already, and it won't tell us anything about what you are doing differently. It might be a scope or closure issue, but there is not enough context in your snippet to tell. Topic: Enter zip or address, return points of interest within radius Rossko <[email protected]> Jul 02 02:56AM -0700 ^ > I have reviewed the article at: > http://code.google.com/apis/maps/articles/phpsqlajax_v3.html ... > But what I need to be able to do is allow my visitors to input their > zip/postal code (or address) + a radius, then return the businesses in > that radius. That is exactly what this example does http://code.google.com/apis/maps/articles/phpsqlsearch_v3.html Topic: Distance per pixel at a given zoom level William <[email protected]> Jul 02 01:53AM -0700 ^ > Or alternatively, is there a method for approximately pre-determining the > bounds > (latlong co-ords) of a map - that is yet to be rendered - from a given centre > point, > zoom-level and map pixel resolution (say 300x300 pixels)? something like this: bounds = calculateBounds(map, center, zoom, 300, 300); function calculateBounds(map, center, zoom, width, height) { var p = map.getProjection(); var c = p.fromLatLngToPoint(center); var z = 1 << zoom; var dx = (0.5*width)/z; var dy = (0.5*height)/z; return new google.maps.LatLngBounds( p.fromPointToLatLng( new google.maps.Point(c.x-dx, c.y+dy) ), p.fromPointToLatLng( new google.maps.Point(c.x+dx, c.y-dy) ) ); } ... Topic: region biasing uk problems getting it to work Rossko <[email protected]> Jul 02 01:34AM -0700 ^ > Also for the region of Devon which google maps picks up fine I get > ZERO_RESULTS I seem to recall Devon as a bit of an oddball, Americans imagine it is called Devonshire ... -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en. -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
