Skip to content

Marker.js: - TypeError: Cannot read property 'DROP' of undefined #29

Description

@michaelhna

Hello,

First of all I would like to thank you for writing and sharing this library!

I am working in WebIDE, using XML views and JS controllers. I have added a map in my 'Detail.view.xml' view similar to your blog post, and included the library in my 'Component.js' file (sap.ui.getCore().loadLibrary("openui5.googlemaps", "../openui5/googlemaps/")), and the map loads fine (I'm able to interact with it, move the draggable marker, etc).

I now wish to use the marker and polygon libraries to do some geofencing. In my 'Detail.controller.js' controller, I am unable to reference 'openui5.googlemaps', as it says "openui5 is not defined".

Instead, I have included the libraries using relative paths in 'sap.ui.define' at the top of the controller. Polygon.js loads without error, however, Marker.js gives the following error, so my controller won't even load: "Error: failed to load 'projectproperties/openui5/googlemaps/Marker.js' from ../openui5/googlemaps/Marker.js: TypeError: Cannot read property 'DROP' of undefined"

A similar error also happens when trying to include Map.js, except it complains about property 'ROADMAP'.

Do you know what would be causing these errors? Or do you have any suggestions for how to better utilize these libraries in my controller (for example, actually referencing the 'openui5.googlemaps' that was loaded in my component)? I cannot simply define 'projectproperties/openui5/googlemaps' like I did with Polygon.js, as it looks for an actual JS file with the name "googlemaps.js".

I have included a picture of my folder structure for reference, as well as the 'sap.ui.define' in my controller - please let me know if any other pictures/information would be helpful.
9-20-2017 1-48-19 pm

9-20-2017 1-59-05 pm

Thanks,

Michael

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions