GithubHelp home page GithubHelp logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on May 19, 2024
If you use it offline you could just add 
if ( google.maps ) {
    // the plugin code here
}

About "initialize the plugin manually" - I need more explanation. 

Original comment by johansalllarsson on 24 May 2011 at 5:20

  • Added labels: Priority-Low, Type-Enhancement
  • Removed labels: Priority-Medium, Type-Defect

from jquery-ui-map.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 19, 2024
I meant that the code in jquery.ui.map.js that extends $.fn and creates the 
ui.gmap object should only be executed when the client code calls some init() 
method, rather than being wrapped in a self-executing function. Otherwise it 
can throw a reference error on startup because google and google.maps are 
undefined, and can break unrelated click, rightclick, dblclick, etc. event 
handlers in the application because of the reference to google.maps.MVCObject 
in addEventListener.

I understand that a user of the library can modify the source file as needed to 
put in the needed checks, but ideally, library code should not easily break 
unrelated functionality. Deferring the plugin initialization to a manually 
called method would allow client applications to avoid these problems.

Original comment by [email protected] on 24 May 2011 at 5:46

from jquery-ui-map.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 19, 2024
[deleted comment]

from jquery-ui-map.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 19, 2024
You are correct that the plugin shouldn't break any jquery core events if you 
are missing the google maps source. Thanks for pointing this out :). I've fixed 
that in the trunk. With this fix there is no need for any init method.

Original comment by johansalllarsson on 25 May 2011 at 3:28

  • Added labels: Type-Defect
  • Removed labels: Type-Enhancement

from jquery-ui-map.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.