ThinkGeo.com    |     Documentation    |     Premium Support

Microsoft JScript runtime error: 'mapParser' is undefined

I'm adding a map to the page dynamically in a postback.


When using 3.1.15 I was getting the above error, but adding a 'fixed' hidden map to the bottom of the page fixed it.


Now I've upgraded to 3.1.16 that hack appears not to work. I always get the error when adding the pat to a page (inside an ajax postback.).


The debugger stops highlighting the following code: document.getElementsByTagName("head")[0].appendChild(a)


Matt



Matt,



it's a known bug that the script cannot be resisted properly when dynamically generating a map within an update panel. We are still working on it and hopefully we can fix it in the next version. For now, please paste the attached scripts in the “form” tag block to work it around.



Thanks,



Ben



468-script.txt (502 Bytes)

Yes, that fixed it. 
  
 One step forward, er one step back

Hopefully in next version, you will not need those "patches". :) 
  
 Ben

I’m having the same issue. I see the code points to some javascript files but I can’t seem to locate them to add to my project?

Gene,



We have tested it and it runs well, and this bug has been fixed in the last public release edition. We guess that maybe your web config file lacks the information about GeoResource.axd. You could add this to the httpHandlers section manually, the code likes below:




<add path="*_GeoResource.axd" verb="*" type="ThinkGeo.MapSuite.WebEdition.GeoResourceFactory" />



Any more questions please let me know.



Thanks,

Johnny



I checked and this was already in my web config so no luck there. I followed your sample how to guide pretty close. I also checked out your samples that come with the demo version and tried that code. Where does this mapParser object come from and what needs to be present for it to be created?

Gene, 
  
 mapParser is a JavaScript class we defined in our WedEditon; it is used to parser all json data related with the map control which comes from server side and  interact with OpenLayers classes. Users don’t need to present anything for it to be created. 
  
 Any more questions please let me know. 
  
 Thanks, 
  
 Johnny 
  


Hi Johnny,


We are using master page .  In the content page, in  head content..  I put the scripts which you given.. I tried with registerscript method also.


In firefox it works fine.


But When check in IE7 browser, Javascript error showing saying ----- 'theForm' is undefined. 


hereby I attached the script. 


 



Raja, 
  
 If the page does not have a form tag  either the script referencing theForm occurs before the declaration, then the variable declaration will fail and the variable “theForm” won’t be able to be created. The problem you have encountered maybe was caused by that you have pasted the attached scripts before the “form”  opening tag; please paste the script after the “form” opening tag, not in the head content if you need to do this. 
  
 Any more questions please let me know. 
  
 Thanks, 
  
 Khalil

I am getting an error "MapParser is undefined" when executing 
 var parserMap1=new mapParser(jsonMap1); 
 This is on my development box. 
 I just upgraded to Windows 7 
  
 I am running 
 MapSuiteCore 3.1.16 
 WebEdition 3.1.16 
  
 I have in the web.config 
 <add path="*_GeoResource.axd" verb="*" type="ThinkGeo.MapSuite.WebEdition.GeoResourceFactory" /> 
  
 I added after the <form> open statement 
  
 <script type='text/javascript' src='opl_GeoResource.axd'></script>
<script type='text/javascript' src='extension_GeoResource.axd'></script>
<script type='text/javascript' src='helper_GeoResource.axd'></script>
<script type='text/javascript' src='parser_GeoResource.axd'></script>
<script type='text/javascript' src='func_GeoResource.axd'></script>
<script type='text/javascript' src='cm_GeoResource.axd'></script>

Any additional Ideas on what to do?
Thanks!


 


Hi, Cyndi
 
Thanks for your information about this problem.
 
Yes, this bug does exist in the previous version. Have you tried the last release version of 4.0.40.0? I think we have fixed it and you can get expected result.
If you still have issues then, please send us the code you are using so that we can focus on that.
 
Thanks,
 
Khalil

That solved the problem - I encountered another one - will post separately - thanks Cyndi



Hi, Cyndi 
  
 Thanks for your feedback. Any problems just feel free to let us know. 
  
 Thanks, 
  
 Khalil