Google map is not working Properly in ajax request - asp.net

Hi I have one web application where i am using google map in my site. For Fetching Marker points I am using ajax request. In First time When I am using this it's working perfect but when i tried for second time (ANY refresh). Then it's showing only half google map.
I am using version 2 google map api.
Please help me to find the solution.
Thanks in Advance.

hard to say what is your problem here. You might want to try to redraw the map by using
map.checkResize();
or in google maps api v3:
google.maps.event.trigger(map, 'resize');
But this normaly shouldn't be needed...

Related

Hi all, I want to develop navigation app in using Xamarin forms. What I can use?

I want to develop navigation appLike this in using Xamarin forms. What I can use? I'm open to use any Xamarin.Forms.map or Xamarin.Forms.GoogleMap. It should let me know distance and time required. Please find attached screen shot.
Yes I have did this. Using Xamarin.Forms.GoogleMap and Google direction API. Created poly line using coordinates received from Google direction API. Google direction API contains encoded "polyline". We have to decode "polyline" and then we got Positions. Using that positions we can create polyline and google map will draw that polyline itself. Google map is having property polylines(its a list) in which we have add newly created polyline. Thanks to Google.

Dynamically addressing kml in Google Earth API for Google Maps v3

I'm using Google Earth API for Google Maps v3 to display kml files in a window which can then be switched between Maps and Earth browsers. This is a different plugin to that officially provided by Google, and I've run into a problem dynamically switching kml in the Earth window. I use checkboxes to switch them in the Maps API V3, window, but when the browser is switched to Earth it no longer listens to the checkbox actions. Essentially what I'm trying to do is a replication of the interactive checkbox example on the google code playground, but I think I should be using the Maps V3 scripts?
I've included a link to the example script here:
http://commondatastorage.googleapis.com/webgistank/TRMM_Checkbox_Example.html
Any help is greatly appreciated!
Regards,
Kerry
You have errors in your code. For example, the line
google.maps.event.addListenerOnce(map, 'tilesloaded', addOverlays);
references the non-existent function addOverlays
Also, I'm not sure what you mean...
"This is a different plugin to that officially provided by Google"
...as it is the exact same plugin.
You also state that...
"...it no longer listens to the checkbox actions."
It is the browser listens for the actions, not the Earth plug-in. The checkboxs event are still firing, the reason the code doesn't work is that the "Google Earth Api" (the api for controlling the plugin) uses totally different objects and methods to the Google Maps Api (the api for controlling the map). Things like google.maps.KmlLayer just don't exist in the Earth Api at all. So when the checkbox event fires it causes and error because you are calling methods on objects that don't exist.
From looking at your code, after initialising the Earth plugin via
googleEarth = new GoogleEarth(map);
You don't do anything else with it...You mention in your question the interactive checkbox example on the Google code playground, but as far as I can see you haven't actually implemented any of the code from that example.
Take another look at the function loadKml method in that example - it clearly shows how to load and display data in the Earth plugin.

Show google map in my site with particular location in asp. net

I want to show google map in my site with pointing a location in the google maps in asp.net can anybody help me please....steps to get the key and all those stuff....
Thank u
You can use Google maps api in your asp.net page.
You will find helt at http://www.codeproject.com/Articles/291499/Google-Maps-API-V3-for-ASP-NET
Take a look at the below sample code.
Its pretty straight forward
http://www.codeproject.com/Articles/291499/Google-Maps-API-V3-for-ASP-NET
Here is the specific one you are looking for.
http://www.aspdotnet-suresh.com/2013/01/show-user-current-location-on-google.html

How to search only within the displayed map with google maps?

Airbnb has a feature on their main search page that only the results in the map are shown. Is it something that is supported by the google maps api ?
I am using the gem gmaps4rails. I havn't found this in neither in the google maps api not in the gem.
Basically what I want is the bounds of the map so that I know what constraints to search with, so that the results fit in the map.
How do you think it can be done ?
The Map-class has a method called getBounds().

Google maps api marker info in sidebar

I'm currently creating an interactive web map using Google Maps Javascript API version 3. I'm not sure if this is possible but I would like to create a series of map layers consisting of different kml files that could be toggled from the side bar. I would also like to be able to access the individual points within the kmls so that when the user clicks on a particular point, photos, text etc. can be loaded outside the map window...
Any ideas on how to accomplish this? I've been searching for a while and only found ways of configuring the infowindow which I personally find unattractive...
There is a way to load KML into a google maps application natively, there is actually a pretty good example of how this is done here:
http://gmaps-samples-v3.googlecode.com/svn/trunk/layers/layers.html
One trick I will mention is that since the KML is downloaded to Google's servers in order to be rendered on the map, it must exist on a public facing web server somewhere, Google won't be able to access it from your local machine.
I found this tutorial which seems like it'll do the trick!

Resources