Search code examples
javascriptjquery-mobilereferenceopenlayers

OpenLayers with jQuery Mobile


So, under this hyperlink : EXAMPLE i have some example of use OpenLayers and jQuery Mobile. Unfortunately, i have one issue with this example :

ReferenceError: OpenLayers is not defined

Of course everything works fine when i remove jQuery Mobile library, but when i will use them above error occur.


Solution

  • I looked at your example.

    The OpenLayers.js must be referenced first. Change the script include order from:

    <script src="resources/js/mobile.js"></script>
    <script src="resources/js/OpenLayers.js"></script>
    

    To:

    <script src="resources/js/OpenLayers.js"></script>
    <script src="resources/js/mobile.js"></script>