jQuery-Store-Locator-Plugin icon indicating copy to clipboard operation
jQuery-Store-Locator-Plugin copied to clipboard

storeLocator is not a function when using with require.js

Open jephjohnson opened this issue 9 years ago • 6 comments

If I include all the required js files inline the plugin works fine. If I include them using require.js the function is returned null. "storeLocator is not a function". Any thoughts on how to solve this?

jephjohnson avatar May 13 '16 16:05 jephjohnson

bump

masecode67 avatar Sep 01 '16 02:09 masecode67

Bump. I am having this issue as well. Thanks in advance

mattvosloo-cuberoute avatar Nov 06 '17 12:11 mattvosloo-cuberoute

up

UpSage avatar Jun 18 '18 01:06 UpSage

1

ansuman13 avatar Oct 10 '18 11:10 ansuman13

`require( ['handlebars', 'jquery', 'locator'], function(Handlebars, $) {

window.Handlebars = Handlebars;

var useLocator = $('#bh-sl-map-container');

/* Map */ if(useLocator){ useLocator.storeLocator({ dataType: 'json', dataLocation: '/stores.php', infowindowTemplatePath: '/infowindow-description.html', listTemplatePath: '/lib/store-locator/assets/js/plugins/storeLocator/templates/location-list-description.html', mileLang: 'mi.', milesLang: 'mi.', openNearest: true, distanceAlert: -1, mapSettings: { zoom: 10, mapTypeId: google.maps.MapTypeId.ROADMAP }, storeLimit: 10 }); }

}); `

UpSage avatar Oct 10 '18 11:10 UpSage

ok i am new to requirejs.

how to define the Plugin in requirejs ?

any advice?

baenschplus avatar Mar 31 '21 04:03 baenschplus