Menu
  • HOME
  • TAGS

google maps refresh without displaying gray

javascript,jquery,mongodb,google-maps,google-maps-api-3

You can first set the visibility of the div which contains map to hidden; then listen to the first tilesloaded event, and set the visibility back to visible. Doing this the Maps should only pop up after all it tiles is loaded (so no gray screen) Here is a quick...

Hidden labels reappear when switching to satellite view

javascript,google-maps,google-maps-api-3

If you don't want the HYBRID map type available, remove it from the types available. https://developers.google.com/maps/documentation/javascript/maptypes The following map types are available in the Google Maps API: MapTypeId.ROADMAP displays the default road map view. This is the default map type. MapTypeId.SATELLITE displays Google Earth satellite images MapTypeId.HYBRID displays a mixture...

I want to insert few location in to java script array using a another array

javascript,google-maps

Your example contains the error, in particular at line where request object is initialized, waypoints array could not be initialized that way. One option would be to place the waypoints array initialization outside of request object initialization as demonstrated below. Fixed example var directionsDisplay; var directionsService = new google.maps.DirectionsService(); var...

ACF Multiple Map Markers

wordpress,google-maps,google-maps-api-3,acf

You can create a custom query and loop through all locations. var locations = [ <?php $args = array( 'post_type' => 'your_post_type', 'posts_per_page' => -1 ); $locations = new WP_Query($args); if($locations->have_posts()){ while($locations->have_posts()){ the_post(); $loc = get_field('location') ?> ['<?php echo get_the_title(); ?>', <?php echo $loc[0]; ?>, <?php echo $loc[1]; ?>], <?php...

Showing content from an Array inside infowindow on marker click

javascript,google-maps,infowindow,geocode,google-geocoding-api

Like this: https://jsfiddle.net/jvxppeap/2/ The trick is: make an array that holds the marker objects. Then, inside addListener(marker, 'click' ... you check which of the markers has been clicked upon; look at "indexOf" in my code. With that index, you can read the right item of someArray, and you can add...

Change the URL of a KML file that Google Maps references on button click

javascript,google-maps

I have manipulated your data a a bit to be more generic. You have to declare map and ctalayers as global objects, load the new KML URL and render it to the map as: ctaLayer = new google.maps.KmlLayer({ url: kmlURL}); ctaLayer.setMap(map); Full demo: http://jsfiddle.net/Rsp22/2209/...

Touch events for google maps on mobile

javascript,jquery,google-maps,google-maps-api-3

if you try this google maps event demo site on your phone/tablet, you would realize nothing happen even when you do a long click. It just means Google Maps support no tablet events. But with jQuery, you can detect a long click, or other "mobile only" events. However, jQuery has...

Google Map Direction using comgooglemaps

ios,google-maps,directions

In order for this URL Scheme to work you need to have the Google Maps app installed. If you want to use the callback option, you need your app to respond to some URL Scheme. In order to do so, please check this link. After that, pass your custom...

Dynamically change Google Maps icon by type in array data

javascript,arrays,google-maps,google-maps-api-3

You need to modify a little bit your code, this should do the trick: for (var i = 0; i < stories.length; i++) { var storydata = stories[i]; var iconString = ''; switch (storydata.type) { case 'Agrifood': iconString = 'http://maps.google.com/mapfiles/ms/icons/green-dot.png'; break; case 'Biotechnology': iconString = 'http://maps.google.com/mapfiles/ms/icons/pink-dot.png'; break; case 'BuiltEnvironment': iconString...

I can't get google maps API to work with my simple web page?

javascript,google-maps

you have three issues: you need to close your initialize function You are missing a semicolon at the end of mapProp2 You need to set the size of the map the following should get you started: function initialize(){ var mapProp1 = { center: new google.maps.LatLng(39.336822, -84.218045), zoom:9, mapTypeId: google.maps.MapTypeId.ROADMAP };...

Ruby Geocoder Access Result info

ruby-on-rails,ruby,google-maps

Geocoder returns an array of results: require 'geocoder' result = Geocoder.search '53593' result.class #⇒ Array < Object So, here you go: result.first.city #⇒ "Verona" ...

Info Window not closing automatically (Google Maps)

javascript,html,google-maps

To get the infowindows to close when you click on another layer, set suppressInfowindows:true, then add a click listener to each layer that calls your openInfoWindow function. Declare a single global InfoWindow for all the layers to use. for (var i = 0; i < layers.length; i++) { layers[i].setMap(null); google.maps.event.addListener(layers[i],...

How to plot data points at particular location in a map in R

r,google-maps,ggmap

This should get you headed in the right direction, but be sure to check out the examples pointed out by @Jaap in the comments. library(ggmap) map <- get_map(location = "Mumbai", zoom = 12) df <- data.frame(location = c("Airoli", "Andheri East", "Andheri West", "Arya Nagar", "Asalfa", "Bandra East", "Bandra West"), values...

Google map api load grey map instead of map images

javascript,jquery,google-maps,google-maps-api-3

You must also register the custom mapType for the map. Place this line after the line where you create the google.map.Map-instance: gmap.mapTypes.set('Styled', styledMapType); However, when you only want the map to appear in a single style you don't need to create a custom mapType, you may apply the styles directly...

How to implement centered marker in Google Maps API v3 with Ionic & Angular

javascript,angularjs,google-maps,google-maps-api-3,ionic

This should do the trick. Javascript var options = { timeout: 10000, enablehighAccuracy: false }; $cordovaGeolocation.getCurrentPosition(options) .then(function(position) { var myLat = position.coords.latitude; var myLong = position.coords.longitude; console.log(myLat, myLong); var center = new google.maps.LatLng(myLat, myLong); var mapOptions = { center: center, zoom: 16, mapTypeId: google.maps.MapTypeId.ROADMAP, streetViewControl: false, mapTypeControl: false, zoomControl: false...

Retrive geolocation in real time (HTML5)

javascript,html5,google-maps,gps,geolocation

setInterval(function, delay) or (function(){ // do some stuff setTimeout(arguments.callee, 60000); })(); The second aproach guarantees, that the next call is not made before your code was executed. The final code will depends on the choosen aproach. could be var map; var geocoder; var delay = 1000; function initialize() { var...

Google Maps v2 for Android map tiles overlapping

android,google-maps,mapbox

you can just use: map.setMapType(GoogleMap.MAP_TYPE_NONE); Refs: https://developers.google.com/android/reference/com/google/android/gms/maps/GoogleMap#setMapType(int) https://developers.google.com/android/reference/com/google/android/gms/maps/GoogleMap#MAP_TYPE_NONE...

vb google maps specific location

vb.net,google-maps

The WPF form has a loaded event, you can add some code there to load your first map: Private Sub MainWindow_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded ShowMapButton_Click(sender, e) End Sub In this case I hardcoded an address into the AddressTxtBox and called Show Map. You can add whatever...

How to generate a component multiple times in JSF?

google-maps,jsf-2,gmaps4jsf

You can use <c:forEach> for that. <m:polygon lineWidth="4"> <c:forEach items="#{bean.points}" var="point"> <m:point latitude="#{point.latitude}" longitude="#{point.longitude}" /> </c:forEach> </m:polygon> The <ui:repeat> is unsuitable as it doesn't build the component tree. A theoretical alternative would be to use a fictive <m:points> component from the GMaps4JSF, if it has one. See also: JSTL in...

mapFragment.getMapAsync(this) - NullPointerException

android,google-maps,android-maps-v2

You are attempting to find a fragment before it exists. You indicate that the layout that has the fragment is fragment_example_map.xml. However, you are trying to find the map fragment before you inflate that layout file. This will not work. Beyond that, you appear to be trying to get at...

how to display google map with out having internet connection in android

android,google-maps,google-maps-android-api-2

Your phone must need internet connection to load map for the first time. Then it'll show up easily.

Add Marker in Angular-Google-Maps

javascript,angularjs,google-maps,google-maps-api-3

I have created the fiddle. Here is the HTML. <div ng-app="main" ng-controller="mainCtrl"> <ui-gmap-google-map center="map.center" zoom="map.zoom" draggable="true" events="map.events"> <ui-gmap-marker ng-repeat="m in map.markers" coords="m.coords" icon="m.icon" idkey="m.id"></ui-gmap-marker> </ui-gmap-google-map> </div> The controller is like this. angular.module('main', ['uiGmapgoogle-maps']) .controller('mainCtrl', function ($scope) { angular.extend($scope, { map: { center: { latitude:...

Add or Remove Polygons Based on Zoom Levels

javascript,google-maps

you are show and hide only the last polygon in your code. The solution is based on an array of polygons and a for cicle to show or hide all the polygons. see this jsfiddle for the complete functioning version. these are the main parts extract var polygons = []...

New Google Maps query string syntax for a marker

google-maps,query-string

Try this is in the format you need. The first with marker the second without https://www.google.com/maps/place//@46.090271,6.657248,16z https://www.google.com/maps/@46.090271,6.657248,16z you must add the place/ between maps/ and /@...

Android Google Maps is blank in release mode

android,google-maps

The direct cause of the issue is that the debug version of an app can work without the google_maps_key being correct. I had the api_key entered, but incorrectly somehow. I'm not sure exactly what changes solved the issue, but I deleted some comments and spaces in the google_maps_api.xml. This solved...

How to get location after updates?

java,android,google-maps

The call to request location updates does just that, it requests location updates. After you make that call, new locations will come in to onLocationChanged() If you want to always have the current location saved, you can do so with member variables. Note that there is no need to log...

Is it possible to filter the GMSPlacePicker based on place type/category

ios,google-maps,google-places-api

You can do a HTTP Nearby Search Request, in the request parameter you can set the types=gas_station. In iOS, you can use NSURLSession to do a http request. Sample code: let requestURL = "https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=2000&types=gas_station&key=YOUR_API_KEY" let request = NSURLRequest(URL: NSURL(string:requestURL)!) let session = NSURLSession.sharedSession() session.dataTaskWithRequest(request, completionHandler: {(data: NSData!, response: NSURLResponse!, error:...

Android Google Map in FragmentDialog being overlayed by the Dialog's own gray overlay

android,google-maps,android-layout,android-fragments,layout

So this is how I ended up fixing my little predicament: I set a theme for the dialog, specifically mapDialogFragment.setStyle(DialogFragment.STYLE_NORMAL, android.R.style.Theme_Light_Panel); And added some top and bottom padding in the layout. The result: Big up to saurabh1489 for helping me find the answer!...

Load Google Maps in a tab when tab is picked, and not from begining

java,android,google-maps,android-fragments,tabs

The FragmentPagerAdapter will always load both of your fragments simultaneously (since the user could swype to the next tab in any moment), and you cannot make the number of preloaded Fragments less then 2 (one for each side). If you want you can just initialize the map after the user...

Uncaught error: Invalid type for google table column

javascript,json,google-maps,google-visualization

You should change your row data.addColumn('String', 'sitecode'); to data.addColumn('string', 'sitecode'); (non capital "s" in "string"), of course this applies to all of your added columns. Javascript is case-sensitive....

Using variables for longitude and latitude with google maps api

javascript,google-maps

You are using strings, please try with floats: var userLng = parseFloat($('#lng').val()); var userLat = parseFloat($('#lat').val()); var mapOptions = { center: { lat: userLat, lng: userLng }, zoom: 8 }; ...

Creating a text input field precisely where a user clicks on a Google Map

google-maps,google-maps-api-3

add an infowindow with a form at the point clicked var formStr = "<input type='text' id='text4mrkr' value='marker text' /><input type='button' value='submit' onclick='addPlace();' />" google.maps.event.addListener(map, 'click', function (e) { infowindow.setContent(formStr); infowindow.setPosition(e.latLng); infowindow.open(map); }); capture the data from the form and add (in this case) a marker with an infowindow containing...

ANDROID PLACE_PICKER (builder.build(context)

android,google-maps,google-places-api

It looks like the main issue is that you're running with an older version of Google Play Services. So in order for it to work for you, you will need to update the version of Google Play Services that is installed on your device or emulator. This also suggests that...

Google map infowindow position on custom marker

javascript,css,google-maps,google-maps-api-3

Set the pixelOffset of the InfoWindow appropriately: From the documentation on InfoWindows pixelOffset | Type:Size | The offset, in pixels, of the tip of the info window from the point on the map at whose geographical coordinates the info window is anchored. If an InfoWindow is opened with an anchor,...

Accessing Coordinates in Nested JSON File

javascript,jquery,json,google-maps

Two suggestion first:: you can assign the coordinates without the $.each(polygons, function (i, n) { ..... } you already have the cooordinate in javascrip format [[......],[.....]] then you don't need to reassign to paths[] second seem you have a nested [] of to much try with your format and then...

I need to assign a value of java-script variable inside in function into php variable in a same file

javascript,php,google-maps

You are getting confused by two languages being present. You forget that your Javascript will run on the client, in the browser. PHP will run on the server. The only way to get the JavaScript value to your server is to HTTP POST/GET it to the server, using a hidden...

how can i plot a route map?

javascript,google-maps,plot

Your code works for me, just fixed some } and ]. http://jsfiddle.net/3qo8kg2o/ But I think you should use polyline instead....

Reverse GeoCoordinate Class gives Location Not found error

android,api,google-maps,google-maps-api-3,reverse-geocoding

Make sure you have latest Google play library in your project. I am using this code and working for me. private class ReverseGeocodingTask extends AsyncTask<LatLng, Void, String> { Context mContext; public ReverseGeocodingTask(Context context) { super(); mContext = context; } // Finding address using reverse geocoding @Override protected String doInBackground(LatLng... params)...

mouse over of lower z-index is called even when its hidden behind the more z-index element

javascript,css,html5,google-maps,google-maps-markers

Please note as per the stacking order of the CSS -first the context is printed -then the element with position and negative z-index are printed -then element without position are printed -after that the element with 0 or auto z-index are printed -the all element with postive z-index and position...

Android Maps Utils Clustering show InfoWindow

android,google-maps,google-maps-markers,infowindow

Here is a simplified and slightly modified solution based on this answer. Note that the linked answer implements an InfoWindow for both Markers and Clusters. This solution only implements InfoWindows for Markers. It's similar to how you would implement a custom InfoWindowAdapter for normal Markers with no Clustering, but with...

Google map get center does not return valid longitude

javascript,php,google-maps

Try this it is working for me var mapCenter = map.getCenter(); var location = new google.maps.LatLng(mapCenter .lat(), mapCenter .lng()); ...

google maps scaleControlOptions changing position of scale on map

javascript,html5,google-maps,google-maps-api-3,html5-canvas

According to the documentation: scaleControl enables/disables the Scale control that provides a simple map scale. By default, this control is not visible. When enabled, it will always appear in the bottom right corner of the map. So unfortunately, you won't be able to put it in the bottom left position....

R stops displaying maps

r,google-maps,ggmap

You are just saving a map into variable and not displaying it. Just do library(ggmap) map <- qmap('Anaheim', zoom = 10, maptype = 'roadmap') map Or library(ggmap) qmap('Anaheim', zoom = 10, maptype = 'roadmap') ...

How to update kml file/layer dynamically?

javascript,google-maps,google-maps-api-3,kml,parcel

geoxml3 parses the KML to native google.maps.Polygon objects. You can process those polygons in the afterParse function: var myParser = new geoXML3.parser({ map: map, afterParse: useTheData }); var kml = myParser.parse('kml/SO_20150619a.kml'); function useTheData(doc) { for (var i=0; i < doc[0].gpolygons.length; i++) { var centroid = new google.maps.Marker({map:map,position: get_polygon_centroid(doc[0].gpolygons[i].getPath().getArray())}); } }...

Update markers on google maps on new wikimapia place request

android,google-maps,google-maps-markers

You should call mMap.clear(); in this method, so when you call this it will clear the map and then reassigned the markers. private void setUpMapIfNeeded() { if (mMap == null) { mMap = ((SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map)).getMap(); mMap.clear(); mMap.setOnMapClickListener(MyLocationActivity.this); if (mMap != null) { mMap.setOnMapClickListener(MyLocationActivity.this); mMap.setMyLocationEnabled(true); mMap.setBuildingsEnabled(true); mMap.setIndoorEnabled(true); mMap.setMapType(mMap.MAP_TYPE_NORMAL);...

Google map infowindow position

javascript,google-maps,events,infowindow

Two issues: There is a typo in your click listener code, javascript is case sensitive, infowindow and infoWindow are different objects, so you are not setting the position of the infowindow correctly. infowindow.open(map); infoWindow.setPosition(event.latLng); You are currently placing the infowindow at the place that is clicked infoWindow.setPosition(event.latLng);. If you want...

Google maps not working in Firefox (gray box)

javascript,google-maps,firefox,google-maps-api-3

innerText is not supported in Firefox. references: 'innerText' works in IE, but not in Firefox W3C DOM Compatibility - HTML ...

distanceBetween or other way to check if current position is in radius to marker

java,android,google-maps,location,latitude-longitude

you can simple use distanceTo(Location location) from Location class todo this, like: Location makerLoc = new Location("marker"); markerLoc.setLatitude(markerPosition.latitude); markerLoc.setLongitude(markerPosition.longtitude); float meters = myLocation.distanceTo(markerLoc); ...

Want a floating window in google map. Something like this: Is there a name for this object? (link/image included.)

css,google-maps

It's a div, which they've styled to float over the map pane. If you inspect the element you can see: <div class="open visible" id="panel"> <div class="mtam-title"> <a href="#" id="minimize"></a> <div id="panel-title">Base Maps</div> </div> <div id="panel-body"> <div class="banner basemaps-banner"> <div class="g-plusbtn"> <div id="___plusone_1" style="text-indent: 0px; margin: 0px; padding: 0px; background: transparent...

SVG Marker on Google Maps Not Appearing

javascript,google-maps,google-maps-api-3,svg

After @geocodezip mentioned that it looked too big, I found the solution from another stackoverflow post. Even though I had tried to resized the image in Inkscape to be a small 24 pixel icon, this wasn't sufficient to make the icon appear at all. I found this post, which was...

Cannot get the my location dot for Google Maps iOS SDK

ios,objective-c,google-maps,google-maps-sdk-ios

First check out following things are there or not. locationManager = [[CLLocationManager alloc]init]; locationManager.delegate= self; if([locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]){ [locationManager requestWhenInUseAuthorization]; } [locationManager startUpdatingLocation]; _mapView.myLocationEnabled = YES; _mapView.settings.myLocationButton = YES; If Everything is there and if you are testing on Simulator then try to change the location in Simulator from debug Tab,...

Google Maps Error - Android app ¦¦ v2

android,google-maps,android-maps-v2

Your error says that Caused by: java.lang.RuntimeException: API key not found. Check that <meta-data android:name="com.google.android.geo.API_KEY" android:value="your API key"/> is in the <application> element of AndroidManifest.xml I think you should add API Key for your project. You must add debug api key. First create xml file on values directory. Name it...

Increase accuracy of GPS (in HTML5 geolocation)

javascript,google-maps,gps

Citing form Geolocation API spec: interface Geolocation { void getCurrentPosition(PositionCallback successCallback, optional PositionErrorCallback errorCallback, optional PositionOptions options) [...] } [...] The enableHighAccuracy attribute provides a hint that the application would like to receive the best possible results. This means you can pass this in an object as the last parameter...

Facing error on Maps API v3 Places Autocomplete Form

jquery,google-maps,google-maps-api-3,autocomplete

I think that you're getting the null pointer when it is attempting to assign the country. Try adding in field for the country, such as <div class="form-group"> <label class="control-label">Country</label> <input type="text" name="country" id="country" value="" placeholder="" class="form-control" maxlength="15"/> </div> When I added that to the JSFiddle you submitted, it worked correctly....

Create a unique URL for linking to data pulled from a database [closed]

javascript,html,sql,google-maps,maps

If you don't want to do anything on the server to provide a unique url, you can use a client side hash with urls in the form /mymap#uniqueId. The hashed part of the url is accessible in javascript like so: window.location.hash You can even set that property on the location...

C# GMapControl GetPoint error

c#,google-maps

Google Maps API for Work client IDs are restricted to URLs specifically authorized. If you try to use your client ID at a URL that has not been authorized, you will receive an error message. Reference Your app is authorized from your PC's IP only, so using your key...

Google Map won't display when page accessed through Rails urlhelper generated link

javascript,jquery,ruby-on-rails,google-maps

'data-turbolinks-track' => true is actually causing this problem. Turn off the data-trubolinks-track to use the Google maps API without having to refresh the page.

Tracing routes in Android

android,google-maps,google-maps-android-api-2

It looks like you just need to add all the necessary imports. Here are all of the imports I used to get it to compile successfully: import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import android.content.Context; import android.graphics.Color; import android.os.AsyncTask; import android.widget.Toast; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import...

How do i add a marker on maps in android programming

android,google-maps

The main issue you mention: the marker fails to show up at the given location It looks like the main reason is that the getLastKnownLocation() is returning null, so it never gets into your code which sets the Marker at the current position. Instead of calling that method, you can...

Google Maps API - Hyperlink in Map Infoview not opening native GoogleMaps

android,google-maps,hyperlink,google-maps-android-api-2,onclicklistener

It looks like it is not possible to make any individual item in an InfoWindow clickable. Refer to this answer. Also, in the documentation here: As mentioned in the previous section on info windows, an info window is not a live View, rather the view is rendered as an image...

angular-google-map angular set radius with range slider

javascript,angularjs,google-maps,angular-google-maps

Finally, I found what's going on. My problem was that the change of sliderValue does not affect the scope. So I remove the on-handle-up in my html on my directive range-slider and add a $watch See Using scope.$watch and scope.$apply for more information. So here's my code: $scope.sliderChange = function()...

What is wrong with this Google Elevation API URL?

python,google-maps,url,polyline,http-status-code-400

The maximum length of a URL is 2,083 characters, the posted URL is at least 2154 characters sources: https://www.google.com/search?q=maximum+length+of+URL [SO] What is the maximum length of a URL in different browsers? ...

how to use geocoder class to retrieve latitude and longitude through ajax

javascript,ajax,google-maps

Because of it's scope, your codeAddress javascript function is not visible for outer caller myLoop, as it is enclosed within myFunction, therefore you get the codeAddress is not defined. Try to rewrite your code similar to this (I have not tested, so it might not work right away, but you...

export KML google map

javascript,google-maps,google-maps-api-3,google-maps-markers

This is not a solution, and a bit half-assed. A year old nodejs-project I dug up. Maybe it can give you a few ideas. Yeah, I realize you want a browser solution. (Sorry!) Browser javascript doesn't work with files very well. But you absolutely can use data URI to make...

How to fully disable streetview from google maps

google-maps,google-maps-api-3,google-street-view

2 possible options(there may be more): prevent the streetView from being visible: google.maps.event.addListener(map.getStreetView(), 'visible_changed', function(){ if(this.getVisible()){this.setVisible(false)} }); try to make the streetview-link in the infowindow un-clickable .gm-sv-label{display:none;} .gm-wsv{pointer-events:none;} I would suggest to use both options together, because the 2nd option may fail in the future(the classNames may change)...

unable to hide two dimensional marker array in Google API 3

javascript,arrays,google-maps,google-maps-api-3

You can't hide a marker based on the elements in your array. They don't have .setMap methods. The markers need to be google.maps.Marker objects. When you create the markers, keep references to them in another array (say "gmarkers"), then use that to hide/show them. proof of concept fiddle (using your...

Load Maps within Fragment

android,google-maps,android-fragments,supportmapfragment

Based on post How to put Google Maps V2 on a Fragment Using ViewPager (see Brandon Yang's answer), I changed the MapaFragment.java code using MapView, and it worked. Like this: public class MapaFragment extends Fragment { Context mContext; private GoogleMap mMap; MapView mMapView; private Location location; private final static String...

Attaching different infowindows to group of polygons google maps

javascript,arrays,google-maps,google-maps-api-3,polygons

Create a function to return the click listener function. Pass the index and the polygon into that function so you get function closure on them to keep them associated: function attachInfoWindow(newPoly, i) { return function (event) { var eventNo = newPoly.get("eventNum"); var outTime = newPoly.get("offTime"); var resTime = objArray[i].restoreTime; var...

Leaving a function to hide the map causes it to show a wrong location as its centre

javascript,jquery,google-maps,google-maps-api-3

Set the center of the map once it has a size. Call .show, trigger resize, then center the map (otherwise it centers in a zero size map in the upper left hand corner of your div...) function showMap() { $("#mymap").show(); google.maps.event.trigger(map, 'resize'); map.fitBounds(bounds); } working fiddle code snippet: function hideMap()...

How can I center the GMSMapMarker view in a coordinate

ios,google-maps,maps,markers,gmsmapview

I found the solution using the property groundAnchor of GMSMarker: _mapMarker.groundAnchor = CGPointMake(0.5,0.5); ...

Remove Markers from Google Maps [on hold]

javascript,google-maps

Same problem here: I've corrected it, change clearMarkers method this way: set_map(null) ---> setMap(null) google.maps.Map.prototype.clearMarkers = function() { for(var i=0; i < this.markers.length; i++){ this.markers[i].setMap(null); } this.markers = new Array(); }; Documentation has been updated to include details on the topic: https://developers.google.com/maps/documentation/javascript/markers#remove...

Core Location and UITableView performance issues in iOS 8

objective-c,uitableview,google-maps,ios8,core-location

Figured out the issue. Turned out that I never stopped the locationManager from updating the current user location so the didUpdateLocations delegate method was being called continuously and consuming resources. Once I sent the stopUpdatingLocation method to the location manager it fixed the problem

Google geocoding viewports

google-maps

The viewport bounds parameter only biases the results. It's not a hard limit. You can read about viewport biasing in the API documentation. However, the viewport returned by Google for a query for "London" does represent a bounding box you can use in your SQL query. You could also use...

google maps click event not working completely correct

javascript,jquery,google-maps

You can't do it this way because at the end of the loop, "i" will always be the last index. And of course when you click on a marker, "i" value inside the callback is the last index, so you should always have the last picture displayed. Just put insertion...

Android Google Mapview Activity not opening in Android Studio

android,google-maps,mapactivity

Your activity creates the layout, but you need some additional code to actually start the map: In MapsActivity.java: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_maps); MapFragment mapFragment = (MapFragment) getFragmentManager() .findFragmentById(R.id.map); mapFragment.getMapAsync(this); } Also, your activity should implement OnMapReadyCallback for more map logic. See the documentation at https://developers.google.com/maps/documentation/android/...

How to integrate SQLite with AngularJS?

angularjs,sqlite,google-maps

Basically, you can not. But you can use a SQLite cordova plugin if you are developing a hybrid mobile application. http://ngcordova.com/docs/plugins/sqlite/ is one of the best SQLite plugins for cordovajs....

android google maps walking directions

android,google-maps,android-maps

I think Google Maps just doesn't know that you can walk over. a workaround would be to draw a simple polyline between the two points if they are close to each other, and if they are both open ground....

Raty Star rating in Google map infowindow

javascript,google-maps,google-maps-api-3,infowindow,raty

Instead of using a string use a node to create the content(to be able to easily access the content via jQuery) store the rating as a attribute of the particular node(to be able to use a single function to create the stars) simple demo: function initialize() { var mapOptions...

How to get a value from label and put in document.getElementById('label').innerHTML

javascript,html,asp.net,google-maps

innerText is one of the ways to retrieve text content and like most of the ways it isn't supported in all browsers. If I am correct innerText isn't supported in Firefox, so if you are testing in Firefox that might be the reason why you can't read the value. What...

AngularJS Custom Google Maps directive with error: 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.`

angularjs,google-maps

Change this: var map = new google.maps.Map(element, mapOptions); To this: var map = new google.maps.Map(element[0], mapOptions); ...

Android Studio: cannot upgrade google play services

android,google-maps,android-studio,google-play-services,google-play-developer-api

If you are using Android Studio open the build.gradle file and enter inside dependencies dependencies { compile 'com.google.android.gms:play-services:4.2.+' } more info Add Google Play Services to Your Project...

Use Google Map V3 API ClientID in Application with no URL

javascript,google-maps,google-maps-api-3,webbrowser-control

about:blank is not a URL, it is in some sense the absence or a URL. In fact, loading the API from about:blank does not send a referer header, and window.location in about:blank is empty. What this means is that you cannot restrict your client id to a specific URL whitelist...

Adding hotspots with identical lat/long

android,google-maps,google-maps-android-api-2

Adding a new marker with identical lat/long will make both remain on the map and in memory.

stuck making a data frame after using street2coordinates (R)

r,google-maps,ggplot2

Currently, your do.call creates a matrix (using rbind and c), coercing all the numeric into characters. The following should turn your list "json" into the data.frame "geocode" will the information you need, i.e. "address", "long" and "lat". foo <- function(x) data.frame(address=paste(x$street_address, x$locality, x$region), long=x$longitude,lat=x$latitude) geocode <- do.call(rbind, sapply(json, foo)) ...

Using maps on api 21+ inside of tab

android,google-maps,android-fragments

You should use a FragmentActivity (or AppCompatActivity), and keep using your Fragment: <fragment xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/map" android:name="com.google.android.gms.maps.SupportMapFragment" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MapsActivity" /> I don't see the usage of MapView anymore, nor in the official guides as of now. You should use SupportMapFragment....

How to permanently change behavior of markers for app?

android,google-maps,marker

You can add the ID of each Marker that you explicitly add to your map in a Set<String> in order to differentiate them from the other Markers on your map. Documentation: https://developers.google.com/android/reference/com/google/android/gms/maps/model/Marker#getId() //instance variables: LatLng latLng; String title; String snippet; Set<String> markerIDs = new HashSet<String>(); When adding a Marker in...

GeoGoogle - Google Geocoder Java API

java,google-maps,geolocation,geocoding

Seems to have moved to a different location: The Google Geocoding API

Issue with Google Maps toScreenLocation() method Android

android,google-maps,opengl-es-2.0,google-maps-api-2

I first tried your code and got no error. According to here, I tired toScreenLocation and it works. Remember set OnGlobalLayoutListener to make sure the map view and waiting for layout process to settle. Sample code: public class MainActivity extends FragmentActivity { GoogleMap mGoogleMap; private static LatLng MountainView = new...

Google maps styled marker z-index change not working

javascript,jquery,google-maps,google-maps-api-3

Solved this by replacing (for example): this.styleIcon.set('zIndex', google.maps.Marker.MAX_ZINDEX + 1); with this.set('zIndex', google.maps.Marker.MAX_ZINDEX + 1); ...

Geochart - mark one country with a special color

javascript,google-maps,charts

If you specify the defaultColor and give Canada no value, this will do exactly what you want. So something like: google.setOnLoadCallback(drawRegionsMap); function drawRegionsMap() { var data = google.visualization.arrayToDataTable([ ['Country', 'Popularity'], ['Germany', 200], ['United States', 300], ['Brazil', 400], ['Canada', null], ['France', 600], ['RU', 700] ]); var options = {defaultColor: 'red'}; var...

Initializing google map depending on form results

javascript,ruby-on-rails,ajax,google-maps

Well, there are several ways on doing that. you can set a promise, or a listener to your AJAX, but the simplest way to do that is just call initialize() at the end of your AJAX code. Since google.maps.event.addDomListener(window, 'load', initialize); basically has the same effect with <body onload="initialize()">, or...

Why Does Map Marker Lurch Around The Map

java,android,google-maps,google-maps-android-api-2

After seeing your other question, it looks like the non-map Activity is getting the onProviderEnabled() callback, but your map Activity is not getting it (unless the GPS radio is enabled during use of the map Activity). Instead of only calling registerForUpdates() in the onProviderEnabled() callback, call it in onCreate() if...

Call php from javascript

javascript,php,html,web-services,google-maps

You're probably looking to implement AJAX. What you would do is separate the PHP code from your Javascript, and make a page that simply outputs the coordinates. You then call this page from your Javascript, and you'll get the result in a variable. The easiest (but not best as you'll...

How do I exclude data from an API call that have a value of nil in Ruby?

ruby-on-rails,ruby,json,google-maps,hashes

You could reject users whose lat or long is nil: users_with_location = users.reject { |user| user.lat.nil? || user.long.nil? } Or reject in place (remove them from your users variable without making a copy): users.reject! { |user| user.lat.nil? || user.long.nil? } So your entire code would be something like: users =...

How to add Google Maps to Android with the latest build?

java,android,xml,google-maps

Intent i6 = new Intent(this, mapsFragment.class); startActivity(i6); mapsFragment is a Fragment. It is not an Activity. You cannot call startActivity() with an Intent that points to a Fragment....

Google Maps adding marker from ajax using jquery

javascript,jquery,google-maps,google-maps-api-3

Edit: Turns out you have to set the .ajaxComplete handler before you make the ajax request since you have set async to false. Here is a working example. I would suggest saving the markers in an array if you intend to use the markers later on(i.e.: move them, or remove...

Geocoder class gives wrong coordinates and won't parse coordinates to get street address. Xamarin

android,google-maps,xamarin,monodroid

If you're using the Xamarin Android Player, the GPS coordinates are simulated. You need to update the location you want. To do this click on Settings then the GPS tab. Your app will see the new coordinates and should return the correct address. ...

Object doesn't support property or method 'setMap'

javascript,html,ajax,google-maps

You are setting marker1 as a Javascript object and not as a google maps marker object, and so it doesnt have the setMap() method that google markers do. To set it as a maps marker object you need to use var marker1 = new google.maps.Marker({ ...

Show Rating bar in google marker

android,google-maps

You have to place your rating bar inside an Info Window: https://developers.google.com/maps/documentation/android/infowindows...