Search Results

Search found 523 results on 21 pages for 'lat'.

Page 12/21 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • google maps api v3 - loop through overlays - overlayview methods

    - by user317005
    how can i loop through an array within the overlayview class? $(document).ready(function() { var overlay; var myLatlng = new google.maps.LatLng(51.501743,-0.140461); var myOptions = { zoom: 13, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById('map_canvas'), myOptions); OverlayTest.prototype = new google.maps.OverlayView(); var items = [ [51.501743,-0.140461], [51.506209,-0.146796], ]; for([loop])//loop through array { var latlng = new google.maps.LatLng(items[i][0], items[i][1]); var bounds = new google.maps.LatLngBounds(latlng); overlay = new OverlayTest(map, bounds); var element_id = 'map_' + i; function OverlayTest(map, bounds) { this.bounds_ = bounds; this.map_ = map; this.div_ = null; this.setMap(map); } OverlayTest.prototype.onAdd = function() { var div = ''; this.div_ = div; var panes = this.getPanes(); panes.mapPane.innerHTML = div; } OverlayTest.prototype.draw = function() { var overlayProjection = this.getProjection(); var sw = overlayProjection.fromLatLngToDivPixel(this.bounds_.getSouthWest()); var ne = overlayProjection.fromLatLngToDivPixel(this.bounds_.getNorthEast()); var div = document.getElementById(element_id); div.style.left = sw.x + 'px'; div.style.top = ne.y + 'px'; } } }); the above code doesn't work, but when i manually assign a lat/lng to the overlayview class it magically works (see below)?! $(document).ready(function() { var overlay; var myLatlng = new google.maps.LatLng(51.501743,-0.140461); var myOptions = { zoom: 13, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById('map_canvas'), myOptions); OverlayTest.prototype = new google.maps.OverlayView(); var items = [ [51.501743,-0.140461], [51.506209,-0.146796], ]; var latlng = new google.maps.LatLng(51.506209,-0.146796);//manually assign lat/lng var bounds = new google.maps.LatLngBounds(latlng); overlay = new OverlayTest(map, bounds); function OverlayTest(map, bounds) { this.bounds_ = bounds; this.map_ = map; this.div_ = null; this.setMap(map); } OverlayTest.prototype.onAdd = function() { var div = ''; this.div_ = div; var panes = this.getPanes(); panes.mapPane.innerHTML = div; } OverlayTest.prototype.draw = function() { var overlayProjection = this.getProjection(); var sw = overlayProjection.fromLatLngToDivPixel(this.bounds_.getSouthWest()); var ne = overlayProjection.fromLatLngToDivPixel(this.bounds_.getNorthEast()); var div = document.getElementById('map_1'); div.style.left = sw.x + 'px'; div.style.top = ne.y + 'px'; } });

    Read the article

  • Convert latitude and longitude into northern and eastings

    - by Rippo
    Hi I have the following UK postcode dy8 3xt and know that the latitude and longitude is:- 52.190108 -2.517266 I also know that the Eastings, Northings for the postcode is:- 389490 283880 However I am struggling to find the equation that converts lat/long to northings and Eastings, I would prefer to have the equation in both in jScript and c# (I am being greedy)! Can anyone help?

    Read the article

  • Alternatives to Goolgle Earth for sat image

    - by Martin Beckett
    I've been asked to add Google Earth images to a desktop app (civil engineering modelling app) I was under the impression that Google's license didn't allow you to do this. Are there any other easily accessible, and similarly high resolution, image sources anyone can recommend (Blue Marble, terraserver) ? As a bonus, any library that lets me use coordinates in a range of local map datums and convert them to Lat/Long without me having to incorporate the whole of CGAL?

    Read the article

  • SQL Server 2008 Geography .STBuffer() distance measurement units

    - by Chris
    I'm working with a geographic point using lat/long and need to find other points in our database within a 5 mile radius of that point. However, I can't seem to find out what the "units" are for STBuffer, it doesn't seem to conform to feet, miles, meters, kilometers, etc. The documentation only refers to them as "units", any suggestions? Thanks [...] from geography::STGeomFromText('POINT(x y)', 4326).STBuffer(z).STIntersects(geography::STGeomFromText('POINT(' + CAST(v.Longitude as varchar(max)) + ' ' + CAST(v.Latitude as varchar(max)) + ')', 4326)) = 1

    Read the article

  • How can I pass latitude and longitude values from UIViewController to MKMapView?

    - by jerincbus
    I have a detail view that includes three UIButtons, each of which pushes a different view on to the stack. One of the buttons is connected to a MKMapView. When that button is pushed I need to send the latitude and longitude variables from the detail view to the map view. I'm trying to add the string declaration in the IBAction: - (IBAction)goToMapView { MapViewController *mapController = [[MapViewController alloc] initWithNibName:@"MapViewController" bundle:nil]; mapController.mapAddress = self.address; mapController.mapTitle = self.Title; mapController.mapLat = self.lat; mapController.mapLng = self.lng; //Push the new view on the stack [[self navigationController] pushViewController:mapController animated:YES]; [mapController release]; //mapController = nil; } And on my MapViewController.h file I have: #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> #import "DetailViewController.h" #import "CourseAnnotation.h" @class CourseAnnotation; @interface MapViewController : UIViewController <MKMapViewDelegate> { IBOutlet MKMapView *mapView; NSString *mapAddress; NSString *mapTitle; NSNumber *mapLat; NSNumber *mapLng; } @property (nonatomic, retain) IBOutlet MKMapView *mapView; @property (nonatomic, retain) NSString *mapAddress; @property (nonatomic, retain) NSString *mapTitle; @property (nonatomic, retain) NSNumber *mapLat; @property (nonatomic, retain) NSNumber *mapLng; @end And on the pertinent parts of the MapViewController.m file I have: @synthesize mapView, mapAddress, mapTitle, mapLat, mapLng; - (void)viewDidLoad { [super viewDidLoad]; [mapView setMapType:MKMapTypeStandard]; [mapView setZoomEnabled:YES]; [mapView setScrollEnabled:YES]; MKCoordinateRegion region = { {0.0, 0.0 }, { 0.0, 0.0 } }; region.center.latitude = mapLat; //40.105085; region.center.longitude = mapLng; //-83.005237; region.span.longitudeDelta = 0.01f; region.span.latitudeDelta = 0.01f; [mapView setRegion:region animated:YES]; [mapView setDelegate:self]; CourseAnnotation *ann = [[CourseAnnotation alloc] init]; ann.title = mapTitle; ann.subtitle = mapAddress; ann.coordinate = region.center; [mapView addAnnotation:ann]; } But I get this when I try to build: 'error: incompatible types in assignment' for both lat and lng variables. So my questions are am I going about passing the variables from one view to another the right way? And does the MKMapView accept latitude and longitude as a string or a number?

    Read the article

  • Java, Sychronize JTable and ResultSet

    - by rodion
    Hello, I have JTable, And AbstarctDataModel with fill(ResultSet rs) methods. How to correct synchronize cursor of JTable with ResultSet's cursor? Any links? Thanx a lat. P.S. Please, add AbstractTableModel tag -- Canton of Uri's citizen

    Read the article

  • Geocoding Chinese addresses using Google Maps API in Python?

    - by Jack Low
    I have looked into Geopy and googlemaps (http://py-googlemaps.sourceforge.net/) and they both do not work for Chinese addresses. My app is stored on the Google App Engine. What I want to do is to parse a file containing addresses of restaurants in Hong Kong, and then Geocode the addresses and store the Lat and Lng in the datastore. How do I do this?

    Read the article

  • how to increase the precision in Locate Me app

    - by thndrkiss
    Hi, I just installed the locate me app and started to understand the CLLocation stuff. I need to know how to increase the number of digits after the lat and long numbers displayed. Can any one help me. currently it shows 17.5968,82.8486. I need more number of digits after decimal(6 digits after decimal.

    Read the article

  • Alternatives to Google Earth for sat image

    - by Martin Beckett
    I've been asked to add Google Earth images to a desktop app (civil engineering modelling app) I was under the impression that Google's license didn't allow you to do this. Are there any other easily accessible, and similarly high resolution, image sources anyone can recommend (Blue Marble, terraserver) ? As a bonus, any library that lets me use coordinates in a range of local map datums and convert them to Lat/Long without me having to incorporate the whole of CGAL?

    Read the article

  • XQuery method question, trying to sum values read from xml

    - by Buck
    I'm pretty new to XQuery and I'm trying to write an example function that I can't get to work. I want to read an xml file, parse out the "time" values, sum them as they're read and return the sum. This is trivial and I'm looking to build more functionality into it but I'd like to get this working first. Also, I know there's a "sum" directive in XQuery that would do just this but I want to add more to it so the built-in sum is insufficient for my needs. Here's my funtion: bool example(Zorba* aZorba) { XQuery_t lQuery = aZorba-compileQuery( "for $i in fn:doc('/tmp/products.xml')//time" "let $sum := xs:integer($i)" " return $sum" ); DynamicContext* lCtx = lQuery-getDynamicContext(); lCtx-setContextItemAsDocument("temp_measurements.xml", lDocStream); try { std::cout << lQuery << std::endl; } catch (DynamicException& e) { std::cerr << e.getDescription() << std::endl; return false; } catch (StaticException& f){ std::cerr << f.getDescription() << f.getErrorCodeAsString(f.getErrorCode()) << std::endl; return false; } } It's called with an appropriate main(). If I comment out the line that starts "let $sum..." then this works in that it returns the time values as a series of integers like this: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3.... Input file looks like this: <?xml version="1.0" encoding="UTF-8"? <temps <temp <time0</time <lat0</lat <long0</long <value0</value </temp <temp <time1</time <lat0</lat <long1</long <value0</value </temp ...

    Read the article

  • plot markers on google maps with json and jquery

    - by mark
    I am trying to plot the markers as defined in a json file om Google Maps but they don't show on the map. Can somebody help me with this problem? This is the Json file: http://sionvalais.com/gmap/markers/ This is the Javascritp function: function loadMarkers() { var bounds = map.getBounds(); var zoomLevel = map.getZoom(); $.post("/gmaps/markers/index.php", {zoom: zoomLevel, swLat: bounds.getSouthWest().lat(), swLon: bounds.getSouthWest().lng(), neLat: bounds.getNorthEast().lat(), neLon: bounds.getNorthEast().lng()}, function(data) { processMarkers(data, _smallMarkerSize); }, "json" ); } function processMarkers(webcams, markerSize) { var marker = null; var markersInView = new Array(); var idsInView = new Array(); // Loop through the new webcams for (var i = 0; i < webcams.length; i++) { var idx = markers.indexOf(webcams[i].id); if (idx == -1) { var info_html = "<table class='infowindow'>"; info_html += "<tr><td class='img'>"; info_html += "<img src='" + webcams[i].smallimg + "' /><td>"; info_html += "<td><p><b>" + webcams[i].loc + "</b>"; info_html += "<br /><a href='/webcam/" + webcams[i].url + "' target='_blank'>Show webcam</a></p></td></tr>"; info_html += "</table>"; marker = new WebcamMarker(new GLatLng(webcams[i].latitude, webcams[i].longitude), {image: "" + webcams[i].smallimg + "", height: markerSize, width: markerSize}); marker.myhtml = info_html; map.addOverlay(marker); markersInView[webcams[i].id] = marker; } else { markersInView[webcams[i].id] = markers[webcams[i].id]; } idsInView.push(webcams[i].id); } // Now remove the markers outside of the viewport for (var i = 0; i < webcamids.length; i++) { var idx = markersInView.indexOf(webcamids[i]); if (idx == -1) { marker = markers[webcamids[i]]; map.removeOverlay(marker); } } markers = markersInView; webcamids = idsInView; }

    Read the article

  • iPhone SDK Point to a specific location

    - by lnetanel
    Hi, I'm trying to develop an application that use the GPS and Compass of the iPhone in order to point some sort of pointer to a specific location (like the compass always point to the North). The location is fixed and I always need the pointer to point to that specific location no matter where the user is located. I have the Lat/Long coordinates of this location but not sure how can I point to that location using the Compass and the GPS... any help will be appreciated. Netanel

    Read the article

  • Great Circle & Ray intersection

    - by Karl T
    I have a Latitude, Longitude, and a direction of travel in degrees true north. I would like to calculate if I will intersect a line defined by two more Lat/Lon points. I figure the two points defining the line would create my great circle and my location and azimuth would define my ray (or possibly a small circle). Any ideas?

    Read the article

  • Using JSON Data to Populate a Google Map with Database Objects

    - by MikeH
    I'm revising this question after reading the resources mentioned in the original answers and working through implementing it. I'm using the google maps api to integrate a map into my Rails site. I have a markets model with the following columns: ID, name, address, lat, lng. On my markets/index view, I want to populate a map with all the markets in my markets table. I'm trying to output @markets as json data, and that's where I'm running into problems. I have the basic map displaying, but right now it's just a blank map. I'm following the tutorials very closely, but I can't get the markers to generate dynamically from the json. Any help is much appreciated! Here's my setup: Markets Controller: def index @markets = Market.filter_city(params[:filter]) respond_to do |format| format.html # index.html.erb format.json { render :json => @market} format.xml { render :xml => @market } end end Markets/index view: <head> <script type="text/javascript" src="http://www.google.com/jsapi?key=GOOGLE KEY REDACTED, BUT IT'S THERE" > </script> <script type="text/javascript"> var markets = <%= @markets.to_json %>; </script> <script type="text/javascript" charset="utf-8"> google.load("maps", "2.x"); google.load("jquery", "1.3.2"); </script> </head> <body> <div id="map" style="width:400px; height:300px;"></div> </body> Public/javascripts/application.js: function initialize() { if (GBrowserIsCompatible() && typeof markets != 'undefined') { var map = new GMap2(document.getElementById("map")); map.setCenter(new GLatLng(40.7371, -73.9903), 13); map.addControl(new GLargeMapControl()); function createMarker(latlng, market) { var marker = new GMarker(latlng); var html="<strong>"+market.name+"</strong><br />"+market.address; GEvent.addListener(marker,"click", function() { map.openInfoWindowHtml(latlng, html); }); return marker; } var bounds = new GLatLngBounds; for (var i = 0; i < markets.length; i++) { var latlng=new GLatLng(markets[i].lat,markets[i].lng) bounds.extend(latlng); map.addOverlay(createMarker(latlng, markets[i])); } } } window.onload=initialize; window.onunload=GUnload;

    Read the article

  • Need to find latitude and longitude of postcodes and store into my database

    - by Matt
    Hey guys, Ive got a database full of UK Postcodes, now i'd like to be able to store the latitude and longitude of these specific postcodes along with the record with the database. Is there anyway that i can obtain this data free without violating any T&C's? I know i could do this using google maps api for each postcode, but i have way over 20,000 postcodes in this database and to get the lat and lng for each of these postcodes each time is not an option really. Thanks in advance, M

    Read the article

  • add extra hint icon at current google map

    - by user315396
    my code is written from http://stackoverflow.com/questions/1171433/jquery-xml-and-google-map Now all marker icons can be displayed at current google map. But now I want to add some function. When getting description of item (it will map to opposite icon) ,if user click this description, a hint will display near the map icon at google. I still can't how to start.I can get lat and lng of location. PS:some of markers will map to same point.

    Read the article

  • bearing in iphone

    - by Jaimin
    i want to make a compass bearing in iphone. like there will be a circle in the corner and it will have 'v' shape drawn inside. so when i start my camera and move than i shlould see the markers... but my first question is a) how to make that circle in the corner whose center will be my current location. so now if i find any point at particular lat long than it should appear as dot in the quadrant.

    Read the article

  • Need Help with Consolidating RoR Google Map Results

    - by Kevin
    I have a project that returns geocoded results within 20 miles of the user. I want these results grouped on the map by zip code, then within the info window show the individual results. The code posted below works, but for some reason it only displays the 1.png rather than looking at the results and using the correct .png icon associated with the number. When I look at the infowindows, it displays the correct png like "/images/2.png" or "/images/5.png" but the actual image is always 1. @ziptickets = Ticket.find(:all, :origin => coords, :select => 'DISTINCT zip, lat, lng', :within => @user.distance_to_travel, :conditions => "status_id = 1") for t in @ziptickets zips = Ticket.find(:all, :conditions => ["zip = ?", t.zip]) currentzip = t.zip.to_s tixinzip = zips.size.to_s imagelocation = "/images/" + tixinzip + ".png" shadowlocation = "/images/" + tixinzip + "s.png" @map.icon_global_init(GIcon.new(:image => imagelocation, :shadow => shadowlocation, :shadow_size => GSize.new(60,40), :icon_anchor => GPoint.new(20,20), :info_window_anchor => GPoint.new(9,2)), "test") newicon = Variable.new("test") new_marker = GMarker.new([t.lat, t.lng], :icon => newicon, :title => imagelocation, :info_window => currentzip) @map.overlay_init(new_marker) end I tried changing the last part of the mapicon from: :info_window_anchor => GPoint.new(9,2)), "test") newicon = Variable.new("test") to: :info_window_anchor => GPoint.new(9,2)), currentzip) newicon = Variable.new(currentzip) but the strangest thing is that any string that has numbers in it causes the map to fail to render in the view and just show a blank screen... same if I replace it with :info_window_anchor => GPoint.new(9,2)), "123") newicon = Variable.new("123") Any advice would be helpful... also it runs a bit slower than my previous code which just set up 4 standard icons and used them outside of the loop so any hints as to speed up execution would be appreciated greatly. Thanks!

    Read the article

  • Google Maps and Json structure

    - by mark
    I found a great script to plot markers on Google Maps. It uses an Json file to laod it. The problem is I don't know what the structure looks like in this case. Can you help? function loadMarkers() { var bounds = map.getBounds(); var zoomLevel = map.getZoom(); $.post("/gmaps/markers/index.php", {zoom: zoomLevel, swLat: bounds.getSouthWest().lat(), swLon: bounds.getSouthWest().lng(), neLat: bounds.getNorthEast().lat(), neLon: bounds.getNorthEast().lng()}, function(data) { processMarkers(data, _smallMarkerSize); }, "json" ); } function processMarkers(webcams, markerSize) { var marker = null; var markersInView = new Array(); var idsInView = new Array(); // Loop through the new webcams for (var i = 0; i < webcams.length; i++) { var idx = markers.indexOf(webcams[i].id); if (idx == -1) { var info_html = "<table class='infowindow'>"; info_html += "<tr><td class='img'>"; info_html += "<img src='" + webcams[i].smallimg + "' /><td>"; info_html += "<td><p><b>" + webcams[i].loc + "</b>"; info_html += "<br /><a href='/webcam/" + webcams[i].url + "' target='_blank'>Show webcam</a></p></td></tr>"; info_html += "</table>"; marker = new WebcamMarker(new GLatLng(webcams[i].latitude, webcams[i].longitude), {image: "" + webcams[i].smallimg + "", height: markerSize, width: markerSize}); marker.myhtml = info_html; map.addOverlay(marker); markersInView[webcams[i].id] = marker; } else { markersInView[webcams[i].id] = markers[webcams[i].id]; } idsInView.push(webcams[i].id); } // Now remove the markers outside of the viewport for (var i = 0; i < webcamids.length; i++) { var idx = markersInView.indexOf(webcamids[i]); if (idx == -1) { marker = markers[webcamids[i]]; map.removeOverlay(marker); } } markers = markersInView; webcamids = idsInView; }

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >