Aptana3 Code Assist with the Google Maps API v3 - google-maps-api-3

I'm trying to enable Code Assist for Google Maps API v3 in Aptana3.
It does not seem to work.
I followed the instructions from this page:
Drop the VSDoc files into your Web Project.
V3 Maps API: gmapvsdoc.codeplex.com
As instructed, I got the zip file from Google Maps API 3 Visual Studio Intellisense Helper
I extracted google-maps-3-vs-1-0.js and google-maps-3-vs-1-0-vsdoc.js in a scripts folder in my project (a PHP project).
This is how I included the API in my html file:
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="scripts/google-maps-3-vs-1-0.js"></script>
The API works fine. I can access all its features.
Yet, when I type 'map.' (after initializing the variable with var map = new google.maps.Map(...)) Aptana has no proposals to assist me with.
Is Aptana3 not compatible with Google Maps API v3?
Have I done something wrong?
Could it be because I'm also using the JQuery Code Assist?

Related

Warning "It looks like you're using the development build of the Firebase JS SDK."

Currently I am getting a warning :
It looks like you're using the development build of the Firebase JS SDK.
When deploying Firebase apps to production, it is advisable to only import
the individual SDK components you intend to use.
For the CDN builds, these are available in the following manner
(replace <PACKAGE> with the name of a component - i.e. auth, database, etc):
https://www.gstatic.com/firebasejs/5.0.0/firebase-<PACKAGE>.js
I have gone through several related links to this problem but even after following all their solutions, I am not able to remove the error.
As the description says to use the given link with the name of the component I am using. I have included the links which I need, still I see the warning.
I have even tried to include all the links given in Firebase website, still I see it.
Currently I am only using Firebase Realtime Database, but while creating firebase init using CMD, I had included Functions, Hosting, Storage and Database.
<script src="https://www.gstatic.com/firebasejs/5.0.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.0.0/firebase-database.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.0.0/firebase.js"></script>
I have even tried changing the versions from 5.0.0 to 5.4.0, but no use.
How to solve this?
I have just solved it by adding two scripts.
<script src="https://www.gstatic.com/firebasejs/5.0.2/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.0.2/firebase-database.js"></script>

Google Maps JS API v2 stopped working

My maps created with Google Maps JS API v2 stopped working few days ago. In JS console I get:
Uncaught ReferenceError: GLatLng is not defined
The reason is that according to https://developers.google.com/maps/documentation/javascript/v2/controls "Version 2 of the JavaScript API has been turned down".
Warning: Version 2 of the Google Maps JavaScript API is no longer available. Please follow the guide to migrate your code to version 3 of the Google Maps JavaScript API. As of November 19, 2013, all applications requesting v2 are served a special, wrapped version of the v3 API instead. We expect this wrapped version of the API to work for most simple maps, but we strongly encourage you to migrate to the v3 API immediately.

Load google map api aynchronously using steal.js

I am trying to executing the following code using steal.js (from javascriptmvc extention):
steal("http://maps.google.com/maps/api/js?sensor=true");
This is working for all other scripts. But, in case of google map api url, its saying "'sensor' parameter isn't set" type error message. How to get rid of this please?
If you can show some other way to load this script asynchronously, that will be ok as well. Like, I tried with google js api loader, but that support for loading google map api up to version 2, no support for 3. Thanks in advance.
You don't typically steal external scripts. steal wont be able to build them into your production file.
Regardless, the current Google Maps API is not intended to be loaded asynchronously. If you examine the source, you'll see it uses document.write, which wont work properly after the page has loaded without the help of a 3rd party library.
Per the comment below, I was wrong. You can load Google Maps asynchronously using the callback parameter:
window.myCallback = function() {
new google.maps.Map(...);
};
$.getScript('//maps.google.com/maps/api/js?sensor=false&callback=myCallback');

How can I resolve a Google Maps API key Issue?

I have been having trouble with the Google Maps API for one week now and I'm unable to resolve it :(
I have a site that has been using the Google Maps v3 for several weeks now without any issues. But suddenly, it starts complaining that: Google has deactivated the use of the Google Maps API for this application, because the offered key is not a valid Google-API-Key or the use of Google Maps v3 is not allowed for this site.
I double checked everything, including: trying a new key; checking domain restrictions and activation in the API-console - Everything is alright.
I'm using simple authentication. Every help would be highly appreciated :)
The Version Handling Has Changed. This Code Is No Longer Valid (see the code below in the update):
One thing you can do immediately to bypass such problems: explicitly set the version of the API you are using to 3.6:
<script type="text/javascript"
src="http://maps.googleapis.com/maps/api/js?v=3.6&sensor=false">
</script>
Keys were introduced in 3.7, so you do not get any warnings if you set your version to: 3.6.
Important Update That Makes the JavaScript Code Above Invalid:
Setting the version to 3.6 will no longer function as a work-around for this, because you are no longer able to request version 3.6. You should not use the code above, but should use the following code to load the Google Maps JavaScript 3.8 library:
<script type="text/javascript"
src="http://maps.googleapis.com/maps/api/js?v=3.8&sensor=false">
</script>
Google recently announced a version update; here is the content of the Google announcement email:
We recently released a new minor version of the Google Maps API. This
means that the versions are now:
3.9: Development/Nightly
3.8: Feature Stable
3.7: Frozen
3.6 has been removed: if you request it you will receive 3.7.
In this latest release of 3.9, we've added:
* Country restriction for Autocomplete (AutocompleteOptions?.componentRestrictions)
* Regions and Cities type filters
You will also get all the features of 3.8 (now Feature Stable),
including:
WeatherLayer and CloudLayer
Click-to-go/Click-to-zoom in Street View
orderBy, limit and offset for FusionTablesLayer
utc_offset and opening_hours in PlaceResult
google.maps.geometry.poly.containsLocation() and isLocationOnEdge()
DemographicsLayer (Maps for Business only)

Object undefined error at var chat = $.connection.chat; while using SignalR

I tried installing SignalR library to create a sample chat application. I believe I have followed all steps given in documentation. I am not sure what could be a reason of failing.
It is failing when it creates a chat object. I am using VS2010 and I downloaded SignalR using VS2010 package download utility.
Is anyone had an issue with this?
Thanks,
Samir
Thanks Hurricanepkt for helping me out.
Yes, I did get all signalR via nuget, using VS2010 'Add Library Package' dialog box. I was getting object undefined error, at var chat = $.connection.chat;
I just made it work but it was ASP.NET Web Application Project. I could not make it work with ASP.NET Website project. I don't know why.
I believe it due to dynamic dll creation in Website Project vs. fixed dll in ASP.NET Web Application Project.
Have you encounter such issue?
What's the name of your hub? If you've changed it to something other than "Chat" then it won't work. I had the same issue because I changed mine to:
public class ChatHub : Hub
{
public void Send(string message)
{
Clients.addMessage(message);
}
}
Within the Javascript this:
var chat = $.connection.chat;
needed to change to
var chat = $.connection.chatHub;
I was frustrated because of the same problem.
It works in Web Project but in Web site it's not. So I checked the script file which is dynamically created.
Left: Web Project - Right: Web Site (http://i.imgur.com/X1XrT.jpg)
As you can see in web site it is not creating "chat" object so it says undefined.
After reading your sentences about dynamic dll creation, I put my code behind file in a seperate .cs file and I put that cs file in App_Code folder. I tried and bam, it worked. Checked the dynamic script file:
(http://i.imgur.com/CSInO.jpg)
I don't know much about the technical issue in here, but putting your code in a seperete Class file which is located in App_Code folder resolves the issue..
Have a nice day
Reading your problem, I ran into this same issue when using it in an MVC3 application.
Can you post your script reference? I can almost bet that you're using something like this, a static location string:
"../script/signalr.min.js"
When you should be using (or the WebForms equivalent of relative paths):
<!-- Used for SignalR -->
<script src="#Url.Content("~/Scripts/jquery-1.6.2.min.js")" type="text/javascript"></script>
<script src="#Url.Content("~/Scripts/jquery.signalR.min.js")" type="text/javascript"></script>
<script src="#Url.Content("~/signalr/hubs")" type="text/javascript"></script>
I ran into this same exact issue today and David Fowler himself helped me.
In any case, read my blog post and follow it to a T and you'll have a working version with MVC3.
http://sergiotapia.com/2011/09/signalr-with-mvc3-chat-app-build-asynchronous-real-time-persistant-connection-websites/
Well I suspect that we have followed the same documentation/tutorial - tutorial for signalR 1.1.3 using ASP.net Web Application(Latest signalR version for .NET framework 4 - higher versions of signalR is not supported).
If you are like me, you should also run signalR in web application without any problem, and then proceed in implementing the same for the website. In my case, it is all about referencing my JavaScript files, thanks to Lars Höppner.
These lines
<script src="/Scripts/jquery-1.6.4.min.js" ></script>
<script src="/Scripts/jquery.signalR-1.1.3.js"></script>
<script src="/signalr/hubs"></script>
should only be
<script src="Scripts/jquery-1.6.4.min.js" ></script>
<script src="Scripts/jquery.signalR-1.1.3.js"></script>
<script src="signalr/hubs"></script>

Resources