So I''m trying (and not succeeding) to add the Nokia Ovi geocoder to
Mapstraction. As with adding the Nokia Ovi Maps API, I started out with cloning
mxn.(provider).geocoder.js and provided the guts of the template functions. So
far, so good. Now to test it out ... and this is where the fun starts.
How to load the geocoding support JavaScript files?
The comments in the header of mxn.js says this ...
// specify which map providers to load by using
// <script src="mxn.js?(provider1,provider2,[module1,module2])" ...
// in your HTML
//
// for each provider mxn.provider.module.js and mxn.module.js will be loaded
// module ''core'' is always loaded
So I try mxn.js?(ovi) which unsurprisingly doesn''t work giving an error
in the JavaScript console of ...
TypeError: Result of expression ''mxn.Geocoder'' [undefined] is
not a constructor.
Next I try mxn.js?(ovi,geocoder) thinking that "geocoder" will be
identified as a module as in the comments in mxn.js. No joy ...
Failed to load resource: the server responded with a status of 404 (Not Found)
TypeError: Result of expression ''mxn.Geocoder'' [undefined] is
not a constructor
... where the 404 shows that the code is looking for mxn.geocoder.core.js.
Next I try pairing mxn.js?(ovi) with mxn.geocoder.js?(ovi) ... still no joy ...
Object definition Geocoder in API ovi not loaded. Are you missing a script tag?
So as a final attempt I look at the Sandbox geocoding example and
that''s using something completely different, including
http://mapstraction.com/mapstraction-js/mapstraction-geocode.js which
doesn''t even appear to be in the Mapstraction source on github,
defining something calls MapstractionGeocoder and not mxn.Geocoder.
So I''m banging my head against the desk and seriously considering
seeking out a beer at 4.20 PM on a Sunday afternoon.
I know I''m doing something wrong and as far as I can see, it''s
not documented (at least not clearly) and the Sandbox seems at odds with the
code on github, noting that the Sandbox code also says that MapQuest is the only
geocoding API supported, which is just plain wrong as the Sandbox example is
using the Google geocoder.
Help? Someone? Please?
G
--
gary at vicchi.org | twitter.com/vicchi | www.linkedin.com/in/garygale |
www.garygale.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20110717/e21d7567/attachment.htm>