w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Phonegap unable to read/render Google Maps API - "Can't find variable Google" error
Solved it! On my index.html file when I was including the Maps API and jQuery URLs, I had <script src="//maps.googleapis.com/maps/api/js?v=3.exp&sensor=true"></script> when I should have been putting... <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=true"></script> and <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> Whether they need to be http or https will require some more research. But for now, it compiles and runs correctly! Hopefully this helps someone else in the future. All of this work is up on my Github in a project I've been working on called TrailFinder. Just check out the Trailfinder/www for the Phonegap stuff. Eventually I'll merge it all into the root of my re

Categories : Javascript

Google Maps Failing to render
I also had a Google Map (v3) embedded within a jQuery UI Tabs, and had to work around the issue with this fix: var initialized = false; $('.tabs').find('.ui-tabs-nav li').each(function() { if($(this).find('a').text() === 'Location') { if($(this).hasClass('ui-state-active')) { initialize(); initialized = true; } else { $(this).click(function() { if(!initialized) { initialize(); initialized = true; } }); } } }); Note that initialize() should run your starting map code. There are lots of ways to slice-and-dice the initialization, but the point is that we don't do it until the tab we're looking for ("Location", in this case) is active.

Categories : Javascript

Parse Google Maps Geocode API Using Json.Net
Try using json2csharp.com to generate your classes. Using this tool, the class structure comes out like this: public class AddressComponent { public string long_name { get; set; } public string short_name { get; set; } public List<string> types { get; set; } } public class Location { public double lat { get; set; } public double lng { get; set; } } public class Northeast { public double lat { get; set; } public double lng { get; set; } } public class Southwest { public double lat { get; set; } public double lng { get; set; } } public class Viewport { public Northeast northeast { get; set; } public Southwest southwest { get; set; } } public class Geometry { public Location location { get; set; } public string location_type { g

Categories : C#

Google Maps Engine - Importing Google Maps "My Maps" Data
Actually it seems like the google maps engine does indeed give you option of importing the maps you saved in your 'My Maps' as layers on to your map. Have a look at the screencap below: It has the option of uploading your csv or xlsx files, but there's also the option right under to add the maps you saved in "My Maps". I assume you'll need to be logged into your Google account with the saved maps to access this though.

Categories : Google Maps

you have included the Google Maps API multiple times on this page - Google maps API and JQuery autocomplete error
Looks like this script: <script src="/scripts/mobile/jquery.mobile-menu.js" type="text/javascript"></script> that's included just before the Google maps API, is somehow interfering with the Google maps API, and if I include the script immediately after including the API, the problem goes away. Not sure exactly why this happens, suspect it may be to do with the order that certain page elements or events are being called or bound. Here's how the mobile menu script is called (from the main.js script that's also being included): $("body").mobile_menu({ menu: ['#main-nav ul', '#secondary-nav ul'], menu_width: 275, prepend_button_to: '#mobile-bar' }); /* Mobile Menu jQuery Plugin * * Creates a side nav bar that mimics the native IOS nav slide drawer * * Author: N

Categories : Jquery

Google Maps API: How do you ensure that the Google Maps Autocomplete text is an actual address before submitting?
The following link describes an example in which you can access autocomplete suggestions: https://developers.google.com/maps/documentation/javascript/examples/places-queryprediction

Categories : Javascript

Can I show different colored points from kml files in Google-Maps overlays?
The following code produces 3 green pushpins and 3 default markers which are currently blue paddles in google map maker. <?xml version="1.0" encoding="UTF-8"?> <kml> <Document> <Style id="TIcon"> <IconStyle> <Icon> <href>http://maps.google.com/mapfiles/kml/pushpin/grn-pushpin.png</href> </Icon> </IconStyle> </Style> <Placemark><styleUrl>#TIcon</styleUrl><Point><coordinates> -125.362289,50.057000,0.0 </coordinates></Point></Placemark> <Placemark><styleUrl>#TIcon</styleUrl><Point><coordinates> -125.363414,50.058000,0.0 </coordinates></Point></Placemark> <Placemark><styleUrl>#TIcon</styleUrl><

Categories : Google Maps

Google Maps API v3 - google.maps.geometry.poly.containsLocation not working the first time
Main reason is at first time google api is not loaded properly and you are trying to use var rsul = google.maps.geometry.poly.containsLocation(new google.maps.LatLng(-12.043333, -77.028333), bermudaTriangle); so it is showing 'Cannot read property 'poly' of undefined' so we need to use timeout to getting work on page load. example: setTimeout(function() { var rsul = google.maps.geometry.poly.containsLocation(new google.maps.LatLng(-12.043333, -77.028333), bermudaTriangle); console.log(rsul); }, 1000); so it is giving proper boolean value

Categories : Javascript

Why won't my KML file(3MB) display on google maps? but working fine for small kml files(like 250 kb)
You might want to check this page on the size and complexity limits. 3MB is the upper limit for a raw kml file, so you're right on the limit. Try to see if your file isn't 3.01Mb in size or something, and try to compress it, see if that helps. Just zip the KML file, and change the .zip extension to .kmz, that should make a difference in size. There's also a layer-limit, that stops any output from being rendered once reached, though I've tried stacking about 15 layers without any problem, so I don't suppose that's likely going to be the issue here But again, check the link, it's all there...

Categories : Javascript

Google Maps API v3 Remove "Click to see this area on Google Maps" link
You could always use JavaScript to make the link do nothing after the map has loaded: var anchors = document.getElementsByTagName('a'), l = anchors.length, i, a; for (i = 0; i < l; i++) { a = anchors[i]; if (a.href.indexOf('maps.google.com/maps?') !== -1) { a.title = ''; a.onclick = function () { return false; }; } } You'd probably have to redo this when the map is changed (cache the anchor tag so you don't have to search for it each time).

Categories : Javascript

How to convert Static Google Maps to Dynamic Google Maps onclick Static maps?
I actually wrote a jQuery plugin quite a while back that converts a static Google Map to a dynamic one. I can't guarantee that every parameter works (like marker styling for example), but it might help. http://andreaslagerkvist.com/jquery/static-to-dynamic-gm/ I actually found this question while Googling for some official way to solve this problem.

Categories : Jquery

Click event not generating on google maps here https://developers.google.com/maps/documentation/javascript/examples/event-simple
You can try zoom out, after click marker for: google.maps.event.addListener(marker, 'click', function() { map.setZoom(8); map.setCenter(marker.getPosition()); });

Categories : Google Maps

Android Google Maps V2 Caused by: java.lang.ClassCastException: com.google.android.gms.maps.SupportMapFragment cannot be cast to android.app.Fragment
Switch super.onCreate first, then setContentView. This is because super.onCreate calls the framework's Activity.onCreate to allocate the resources needed to inflate any layouts. Hence , must be called before inflating any layouts, xml/programmatic.

Categories : Android

google-maps-sdk-ios - arm 7/iphone 5 issues for Google Maps 1.4.3 for iOS
In my app, I have Architectures set to armv7 and Valid Architectures set to armv7 armv7s, for both the project and the target. Are your settings the same?

Categories : Misc

Google Maps API V3 determine which button is pressed in maps mousedown event listener
which is a property of the event object, which most people label as e in their event handlers. It contains the key code of the key which was pressed to trigger the event. As per your code add which to it. google.maps.event.addListener(map, 'mousedown', function (e) { console.log(e.which); } Check console: left Click: 1 middle button click: 2 right click: 3 After checking Google docs, instead of getting the mouse keyCodes you can directly use their mouse event.

Categories : Google Maps

Getting coordinates based in direction in Google Maps/Apple Maps in Objective-C
You need to use Geocoder for that, find a guide here: Geocoding Location Data You can find an example at the end of the document: [geocoder geocodeAddressString:@"1 Infinite Loop" completionHandler:^(NSArray* placemarks, NSError* error){ for (CLPlacemark* aPlacemark in placemarks) { // Process the placemark. } }]; As they say, the more info you provide, the more accurate will be.

Categories : Iphone

Understanding the code for the Google Maps API (Simple Maps), for implementing it into a website?
var mapOptions = { zoom: 8, center: new google.maps.LatLng(-34.397, 150.644), mapTypeId: google.maps.MapTypeId.ROADMAP }; This is setting various options for the map; the zoom level of the map, the initial coordinates of the map and the type of map to use (you can use roadmap, satellite or hybrid) map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); This creates the map object and adds it to your page. google.maps.event.addDomListener(window, 'load', initialize); This attaches an event listener to the window so that when it loads up the initialise function will run thereby creating the map.

Categories : Javascript

Google map showing NetworkError: 403 Forbidden - http://maps.googleapis.com/maps/api/js/QuotaService.RecordEvent
I'm not sure if that's the reason, but there is an issue with your code: var theLat = thePos.jb; var theLng = thePos.kb; and var theLati = thePos.ob; var theLngi = thePos.pb; you try to access properties of the LatLngs(jb, kb, ob, pb) that are used internally by the API, the names of these properties may change . Use the methods lat() and lng() to retrieve latitude and longitude: var theLat = thePos.lat(); var theLng = thePos.lng(); and var theLati = thePos.lat(); var theLngi = thePos.lng();

Categories : Jquery

Why have maps stopped working with the latest Google Maps update?
The problem here is, if you start navigation without enabling gps and then enable it while the app is running, it doesn't sense that gps is on. Its just because it asks if the gps is on when it first turns on. The solution would be that you need to enable gps before entering the app, or if you forget, just back out of the app and re-enter.Also can stop updates to fix the issue. Also have a look at it: Google Services Bug Causing Location Issues, Google Working On A Fix

Categories : Android

Custom Google Maps Engine map on Android Maps v2?
You should be able to create your own TileProvider in order to render your map. You should get all the informations you need here on StackOverflow: TileProvider using local tiles Custom URLTileProvider implementation

Categories : Java

Google Maps Android API V2 not show maps on Emulator
I, too, was tired of trying to make Google Maps v2 to work on Emulator. I ended up using a third party emulator call Genymotion. Not only the maps works perfectly, but it also runs much faster then the regular Android emulator, even faster then a real device. Try it out!

Categories : Android

Google Maps Android Api V2 - maps dont display
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="MyOwnGeneratedKey"/> You need to use Google API console to generate your own key using A1:FE:B5:E2:5E:0E:1A:8E:CC:8F:07:CC:4D:D0:95:13:0B:E7:1B:EC;com.example.mapdemo and then substitute it in the manifest. The format should be something similar to AIzaSyB-sKpf4b9kSM6DX40WyjExC7VTRabAvcw Also, you need to flick the switch on the Google Map API v2 in the services page in the API console.

Categories : Android

Google Maps iOS SDK Integration not loading maps
Typically this will happen if you don't have the app bundle id added to your google APIs console. The bundle id (eg., com.myname.appname) is what google uses to verify that an app is allowed to use a certain api key. If you've moved your app from one developer account to another, you've probably changed the bundle id in the process. Fortunately, google allows you to associate multiple bundle ids with a single api key. To add a new bundle id: Verify the bundle id you are using in xcode (select the target and look under summary) Login to https://code.google.com/apis/console/ Select "API Access" on the left column Select "Edit allowed iOS apps" under the "key for iOS apps" section Add the bundle id used in the enterprise build

Categories : Iphone

iOS maps and google maps SDK - working with coordinates
As you have said, generating random coordinates and checking for streetview availability will be inefficient since many countries do not have streetview coverage. I would recommend the below approach: 1, Get the list of countries with full streetview coverage as given in the list. 2, Choose the set of countries you would like to cover in your app and for those countries create a list of bounding boxes. For example , if you use the geocoding api with the address as a country, then the response will have coordinates of the bounding box that will approximately enclose the country. 3, In your app, retain the list of countries and bounding boxes. Now randomly pick a country from the list and then build a random coordinate that lies within the bounding box for that country. That is SW.lat

Categories : IOS

Migrating from google maps v3 to android maps
Create /assets/simplemap.html Paste Your Map Content in that file like <html> <head> <title>Simple Map</title> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <style> html, body, #map-canvas { margin: 0; padding: 0; height: 100%; } </style> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> <script> var map; function initialize() { var mapOptions = { zoom: 8, center: new google.maps.LatLng(-34.397, 150.644), mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); } google.maps.event.ad

Categories : Android

Google Maps API v2 displaying maps only on one device
Change your max sdk ver to 18 (android 4.3). I suppose this is the device that fail. An other option - If you use the developers SHA-1 (the one you generate from adb) and you instaled the app on the devices from the difrent computers computer, then I assume you need to get the SHA-1 fingerprint for the other computer.

Categories : Android

Allow one instance of Google Maps API to control two maps
As the message states, you should only include the API once. You can create any number of map instances with a single load of the API. Since you always load the small map, one easy solution would be to simply remove the Maps API <script> tag or drupal_add_js() call from the node that creates the large lightbox map. Of course you won't be able to view the map in that node any more if you open it as a standalone page; it will only work as part of your page that already includes the Maps API. Or, you could conditionally include the Maps API script only once on the page. My PHP and Drupal coding is a bit rusty, but I think it would look something like this: if( ! $mapsApiLoaded ) { $mapsApiLoaded = TRUE; drupal_add_js( 'https://maps.googleapis.com/maps/api/js?sensor=fa

Categories : Javascript

Get map center in maps version 2 of google maps
You can use gMap.getCameraPosition().target where gMap is the GoogleMap instance from your activity. This will return a LatLng object which is the coordinate of the center of the map. According to this, the target is "The location that the camera is pointing at."

Categories : Java

Amazon Maps API & Google Maps API
Amazon does not support the Google Maps API of any version.. They use their own API which is nearly identical to the Google Maps v1 but is missing things like traffic and street view. So to answer your question, it is not possible to only build one map solution and work on both Kindle Fire devices and other non-Amazon Androids. As for what devices the Amazon maps api supports it would be all of their Fire devices minus the first generation Fires which run a forked version of Android based on API 10. It IS possible to build both an Amazon map and Google map in the same code base and decide at runtime which to utilize. Here is a nice little blog on some things to keep in mind when doing this. Hope that gives you some direction!

Categories : Android

Gmaps4Rails Google Map Interaction Nearest Location Feature Unfamiliar with Google Maps API
After looking into it a bit more it seems the developer (apneadiving) is actually quite active, just not in the same place, see these guides on features: http://www.youtube.com/watch?v=Yg5-33zedqM There is a second video as well. Looking into it further I can't see a method in the documentation that calculates distance. I recommend trying this tutorial: http://briancray.com/posts/how-to-calculate-the-distance-between-two-addresses-with-javascript-and-google-maps-api Or just following the Distance Matrix service from Google. I haven't tried to use these alongside the gem so you may have to change the code based on existing variables. It should* be easier because you have addresses and Lats/longs saved already. Also have you set the App to initally geolocate the user? I'm working

Categories : Ruby On Rails

Google geocoding fails but address exists when entered into google maps web page
The zip code is not part of that record in the geocoder, if you remove it, the geocoder can resolve the address: http://www.geocodezip.com/v3_example_geo2.asp?addr1=1062%20N%20Main%20St,Bowling%20Green,OH&geocode=1

Categories : Google Maps

How to set the "Google Earth Plugin" view as default in a Google Maps iframe?
Use setMapType to set the desired mapType: map.setMapType(G_SATELLITE_3D_MAP); <edit>: The linked example uses the Maps-API V2, for V3 it's little bit different. Wait for the idle-event of the map and set the mapType to 'GoogleEarthAPI' . Go to line 116 of your document and modify it: if (isGEinstalled) { googleEarth = new GoogleEarth(map); //add the following line google.maps.event.addListenerOnce(map,'idle',function(){map.setMapTypeId('GoogleEarthAPI')}); } else { alert("O plugin de Google Earth não está instalado"); }

Categories : Google Maps

Android - Google Maps, Google Play Services library referencing
You can find the .jar file inside the libs folder of imported library(...android-sdkextrasgooglegoogle_play_serviceslibprojectgoogle-play-services_liblibs). But referencing only that jar file may be improper. I tried to do so for google maps, but didn't work. Suggested way is to import that library project to the workspace and refer the whole.

Categories : Android

finding user current location using Google Maps API (Google Places)
You can use the reverse geocoding services. Here are the docs: https://developers.google.com/maps/documentation/geocoding/?hl=en#ReverseGeocoding Example request (JSON): http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=false Get JSON data on iOS: Not getting json response in google query of longitude and latitude in iOS? For parsing JSON object in iOS, this answer could be usefull for you: How to parse specific googlemaps API webservices JSON repsonse

Categories : IOS

Google Maps v2 : how import google-play-service.jar into Android Dependencies
Have you declared the Activity in your manifest? Edit: Once you import library into your workspace (In Eclipse), you right click on the project, open properties, click android and at the bottom you will see library import section. Add it to that.

Categories : Android

Google Geocoding API returning wrong address, but Google maps showing correct location
The returned result is equal to http://maps.googleapis.com/maps/api/geocode/json?address=Saints%20Peter%20&sensor=false you need to encode the ampersand too (with %26) , otherwise everything that follows the ampersand will be taken as a new parameter and not as part of address correct result: http://maps.googleapis.com/maps/api/geocode/json?address=Saints%20Peter%20%26%20Paul%20Parish%204070%20Central%20Parkway%20East,%20Mississauga,%20L4Z%201T6,%20CA&sensor=false

Categories : Google Maps

Find Google place 'reference key' directly via Google (maps) 'cid'
No. Google api provides mainly 4 searches-- nearby (based on latlng and radius) text based (based on some text...eg name of a place,city etc) radarsearch (gives only the reference id) placedetails (this takes the above reference id and provide all details corresponding to that one reference id) you can find examples and other details here...

Categories : Google Maps

"Google has disabled use of the Maps API for this application. The provided key is not a valid Google API Key"
This is because you need to activate v3 of google maps in your control panel. After that create a new key and it should work From documentation 3 Activate the Google Maps API v3 service.

Categories : PHP

Install Google Settings on HAXM x86 emulator (Google Maps SDK)
As per Google Android Map Api v2 ypu can't run it on an Android Emulator; you need a real device to test your apps. To run a app which uses Google Maps v2 you need two applications already running on the device 1. Google Play Services (com.google.android.gms.apk) 2. Google Play Store (com.android.vending.apk) Follow this guide here to download and install the latest version of these two apk's using adb commands.

Categories : Android

Monodroid Google Maps API v2 - Error contacting Google servers
Ensure that you have really signed your application with the same key which you had used to get the API key. And that the application package is the same as was in API key request. I've lost a few hours with the problem to find out that there was something wrong with application signature. I've signed it manually and map appears.

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.